class Ecoportal::API::V1

@attr_reader client [Common::Client] a `Common::Client` object that holds the configuration of the api connection. @attr_reader logger [Logger] the logger.

Constants

VERSION

Attributes

client[R]
logger[R]

Public Class Methods

new(api_key, host: "live.ecoportal.com", logger: default_logger) click to toggle source

Creates an `V1` object to scope version specific api requests. @note

- The const `VERSION` determineds the api version that client will query against.
- This means that each sublcass of `V1` should define their own `VERSION` constant.

@param api_key [String] the key version to stablish the api connection. @param host [String] api server domain. @param logger [Logger] an object with `Logger` interface to generate logs. @return [V1] an object with the api version suit.

# File lib/ecoportal/api/v1.rb, line 23
def initialize(api_key, host: "live.ecoportal.com", logger: default_logger)
  @logger = logger
  @client = Common::Client.new(
    api_key: api_key,
    host:    host,
    version: self.class::VERSION,
    logger:  @logger
  )
end

Public Instance Methods

people() click to toggle source

Obtain specific object for people api requests. @return [People] an instance object ready to make people api requests.

# File lib/ecoportal/api/v1.rb, line 35
def people
  people_class.new(client)
end
person_schemas() click to toggle source

Obtain specific object for schema api requests. @return [PersonSchemas] an instance object ready to make schema api requests.

# File lib/ecoportal/api/v1.rb, line 41
def person_schemas
  person_schemas_class.new(client)
end