class FedgerAPI::Response

Class implements response

Attributes

response[R]

Public Class Methods

new(response) click to toggle source
# File lib/fedger_api/response.rb, line 6
def initialize(response)
  @response = response
  create_keys!
end

Public Instance Methods

to_a() click to toggle source
# File lib/fedger_api/response.rb, line 15
def to_a
  response.map { |k, v| [k, v] }
end
to_h() click to toggle source
# File lib/fedger_api/response.rb, line 11
def to_h
  response.to_h
end

Private Instance Methods

create_keys!() click to toggle source
# File lib/fedger_api/response.rb, line 21
def create_keys!
  response.each do |key, val|
    instance_variable_set("@#{key}", val)
    define_singleton_method(key) { val }
  end
end