Class: WebPay::EventData
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ EventData
constructor
A new instance of EventData.
-
#object ⇒ Object
attributes accessors.
- #previous_attributes ⇒ Object
Methods inherited from Entity
Constructor Details
#initialize(hash = {}) ⇒ EventData
Returns a new instance of EventData.
1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 |
# File 'lib/webpay/data_types.rb', line 1509 def initialize(hash = {}) hash = normalize_hash(hash) hash['object'] = case hash['object'].is_a?(Hash) && hash['object']['object'] when 'account'; AccountResponse.new(hash['object']) when 'charge'; ChargeResponse.new(hash['object']) when 'customer'; CustomerResponse.new(hash['object']) when 'recursion'; RecursionResponse.new(hash['object']) when 'shop'; ShopResponse.new(hash['object']) else; hash['object'] end @attributes = hash end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
1502 1503 1504 |
# File 'lib/webpay/data_types.rb', line 1502 def attributes @attributes end |
Class Method Details
.fields ⇒ Object
1504 1505 1506 |
# File 'lib/webpay/data_types.rb', line 1504 def self.fields ['object', 'previous_attributes'] end |
Instance Method Details
#object ⇒ Object
attributes accessors
1527 1528 1529 |
# File 'lib/webpay/data_types.rb', line 1527 def object attributes['object'] end |
#previous_attributes ⇒ Object
1531 1532 1533 |
# File 'lib/webpay/data_types.rb', line 1531 def previous_attributes attributes['previous_attributes'] end |