Class: Ecoportal::API::V2::Registers
- Inherits:
-
Object
- Object
- Ecoportal::API::V2::Registers
- Extended by:
- Common::BaseClass
- Includes:
- Enumerable
- Defined in:
- lib/ecoportal/api/v2/registers.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #each(params: {}, &block) ⇒ Object
-
#get ⇒ Enumerable<Register>
Gets all the registers via api request.
-
#initialize(client) ⇒ Schemas
constructor
An instance object ready to make schema api requests.
Constructor Details
#initialize(client) ⇒ Schemas
Returns an instance object ready to make schema api requests.
14 15 16 |
# File 'lib/ecoportal/api/v2/registers.rb', line 14 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/ecoportal/api/v2/registers.rb', line 10 def client @client end |
Instance Method Details
#each(params: {}, &block) ⇒ Object
25 26 27 28 |
# File 'lib/ecoportal/api/v2/registers.rb', line 25 def each(params: {}, &block) return to_enum(:each) unless block get.each(&block) end |
#get ⇒ Enumerable<Register>
Gets all the registers via api request.
20 21 22 23 |
# File 'lib/ecoportal/api/v2/registers.rb', line 20 def get response = client.get("/templates") Common::Content::WrappedResponse.new(response, register_class, key: "registers") end |