class Ecoportal::API::V2::Registers

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

Attributes

client[R]

Public Class Methods

new(client) click to toggle source

@param client [Common::Client] a `Common::Client` object that holds the configuration of the api connection. @return [Registers] an instance object ready to make registers api requests.

# File lib/ecoportal/api/v2/registers.rb, line 17
def initialize(client)
  @client = client
end

Public Instance Methods

each(params: {}, &block) click to toggle source
# File lib/ecoportal/api/v2/registers.rb, line 21
def each(params: {}, &block)
  return to_enum(:each) unless block
  get.each(&block)
end
get() click to toggle source

Gets all the registers via api request. @return [Enumerable<Register>] an `Enumerable` with all schemas already wrapped as `Register` objects.

# File lib/ecoportal/api/v2/registers.rb, line 28
def get
  response = client.get("/templates")
  Common::Content::WrappedResponse.new(response, register_class, key: "registers")
end