Class: Ecoportal::API::V1
- Inherits:
-
Object
- Object
- Ecoportal::API::V1
- Extended by:
- Common::BaseClass
- Includes:
- Common::Logging
- Defined in:
- lib/ecoportal/api/v1.rb,
lib/ecoportal/api/v1/people.rb,
lib/ecoportal/api/v1/person.rb,
lib/ecoportal/api/v1/job_status.rb,
lib/ecoportal/api/v1/schema_field.rb,
lib/ecoportal/api/v1/person_schema.rb,
lib/ecoportal/api/v1/person_details.rb,
lib/ecoportal/api/v1/person_schemas.rb,
lib/ecoportal/api/v1/schema_field_value.rb
Direct Known Subclasses
Defined Under Namespace
Classes: JobStatus, People, Person, PersonDetails, PersonSchema, PersonSchemas, SchemaField, SchemaFieldValue
Constant Summary collapse
- VERSION =
"v1".freeze
Instance Attribute Summary collapse
-
#client ⇒ Common::Client
readonly
a
Common::Client
object that holds the configuration of the api connection. -
#logger ⇒ Logger
readonly
the logger.
Instance Method Summary collapse
-
#initialize(api_key, host: "live.ecoportal.com", logger: default_logger) ⇒ V1
constructor
Creates an
V1
object to scope version specific api requests. -
#people ⇒ People
Obtain specific object for people api requests.
-
#person_schemas ⇒ PersonSchemas
Obtain specific object for schema api requests.
Methods included from Common::BaseClass
class_resolver, redef_without_warning, resolve_class
Constructor Details
#initialize(api_key, host: "live.ecoportal.com", logger: default_logger) ⇒ V1
Note:
- The const
VERSION
determineds the api version that client will query against. - This means that each sublcass of
V1
should define their ownVERSION
constant.
Creates an V1
object to scope version specific api requests.
24 25 26 27 28 29 30 31 32 |
# File 'lib/ecoportal/api/v1.rb', line 24 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 |
Instance Attribute Details
#client ⇒ Common::Client (readonly)
a Common::Client
object that holds the configuration of the api connection.
5 6 7 |
# File 'lib/ecoportal/api/v1.rb', line 5 def client @client end |
#logger ⇒ Logger (readonly)
the logger.
5 6 7 |
# File 'lib/ecoportal/api/v1.rb', line 5 def logger @logger end |
Instance Method Details
#people ⇒ People
Obtain specific object for people api requests.
36 37 38 |
# File 'lib/ecoportal/api/v1.rb', line 36 def people people_class.new(client) end |
#person_schemas ⇒ PersonSchemas
Obtain specific object for schema api requests.
42 43 44 |
# File 'lib/ecoportal/api/v1.rb', line 42 def person_schemas person_schemas_class.new(client) end |