class KeyPayAPI::Resource

Attributes

data[R]

Public Class Methods

new(client, data) click to toggle source
# File lib/keypay_api/resource.rb, line 5
def initialize(client, data)
  data = {} unless data.is_a?(Hash)

  @client = client

  data = data.with_indifferent_access

  @data   = OpenStruct.new(data.with_indifferent_access)

end

Public Instance Methods

method_missing(method_sym, *arguments, &block) click to toggle source
Calls superclass method
# File lib/keypay_api/resource.rb, line 16
def method_missing(method_sym, *arguments, &block)
  if @data.respond_to?(method_sym)
    @data.send(method_sym)
  else
    super
  end
end