Class: Monetra::Response

Inherits:
Object show all
Defined in:
lib/monetra.rb

Overview


Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Response




163
164
165
# File 'lib/monetra.rb', line 163

def initialize(*args)
  @options = args.last.is_a?(Hash) ? args.pop : {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(methId) ⇒ Object




168
169
170
# File 'lib/monetra.rb', line 168

def method_missing(methId)
  @options[methId.to_s]
end

Instance Method Details

#success?Boolean


Returns:

  • (Boolean)


173
174
175
# File 'lib/monetra.rb', line 173

def success?
  phard_code.upcase == 'SUCCESS'
end

#timestampObject




178
179
180
# File 'lib/monetra.rb', line 178

def timestamp
  Time.at(data['timestamp'].to_i)
end