class Mpesa::Object

Public Class Methods

new(attributes) click to toggle source
# File lib/mpesa/object.rb, line 5
def initialize(attributes)
  @attributes = OpenStruct.new(attributes)
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source
# File lib/mpesa/object.rb, line 9
def method_missing(method, *args, &block)
  attribute = @attributes.send(method, *args, &block)
  attribute.is_a?(Hash) ? Object.new(attribute) : attribute
end
respond_to_missing?(_method, _include_private = false) click to toggle source
# File lib/mpesa/object.rb, line 14
def respond_to_missing?(_method, _include_private = false)
  true
end