Class: Espago::BackRequest
- Inherits:
-
Object
- Object
- Espago::BackRequest
- Defined in:
- lib/espago/back_request.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #card ⇒ Object
- #created_at ⇒ Object
-
#initialize(params) ⇒ BackRequest
constructor
A new instance of BackRequest.
- #method_missing(attribute_name) ⇒ Object
Constructor Details
#initialize(params) ⇒ BackRequest
Returns a new instance of BackRequest.
8 9 10 |
# File 'lib/espago/back_request.rb', line 8 def initialize(params) @params = parse(params) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(attribute_name) ⇒ Object
12 13 14 |
# File 'lib/espago/back_request.rb', line 12 def method_missing(attribute_name) params[attribute_name.to_s] end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/espago/back_request.rb', line 6 def params @params end |
Instance Method Details
#card ⇒ Object
16 17 18 |
# File 'lib/espago/back_request.rb', line 16 def card params["card"] || {} end |
#created_at ⇒ Object
20 21 22 |
# File 'lib/espago/back_request.rb', line 20 def created_at Time.at(params["created_at"].to_i) rescue nil end |