Class: Monetra::Response
Overview
Instance Method Summary collapse
-
#initialize(*args) ⇒ Response
constructor
—————————————————–.
-
#method_missing(methId) ⇒ Object
—————————————————–.
-
#success? ⇒ Boolean
—————————————————–.
-
#timestamp ⇒ Object
—————————————————–.
Constructor Details
#initialize(*args) ⇒ Response
163 164 165 |
# File 'lib/monetra.rb', line 163 def initialize(*args) = 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) [methId.to_s] end |
Instance Method Details
#success? ⇒ Boolean
173 174 175 |
# File 'lib/monetra.rb', line 173 def success? phard_code.upcase == 'SUCCESS' end |
#timestamp ⇒ Object
178 179 180 |
# File 'lib/monetra.rb', line 178 def Time.at(data['timestamp'].to_i) end |