Class: GoogleWallet::Resources::Base
- Inherits:
-
Object
- Object
- GoogleWallet::Resources::Base
- Defined in:
- lib/google_wallet/resources/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(attributes: {}, options: {}) ⇒ Base
constructor
A new instance of Base.
- #payload_key ⇒ Object
Constructor Details
#initialize(attributes: {}, options: {}) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 14 |
# File 'lib/google_wallet/resources/base.rb', line 8 def initialize(attributes: {}, options: {}) @options = attributes.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/google_wallet/resources/base.rb', line 6 def @options end |
Instance Method Details
#attributes ⇒ Object
16 17 18 19 |
# File 'lib/google_wallet/resources/base.rb', line 16 def attributes hash = deep_merge(template, ) remove_empty_values(hash) end |
#payload_key ⇒ Object
21 22 23 |
# File 'lib/google_wallet/resources/base.rb', line 21 def payload_key raise 'Define in resource' end |