Class: Kickstapi::Reward
- Inherits:
-
Object
- Object
- Kickstapi::Reward
- Defined in:
- lib/kickstapi/reward.rb
Instance Attribute Summary collapse
-
#backers ⇒ Object
Returns the value of attribute backers.
-
#delivery_date ⇒ Object
Returns the value of attribute delivery_date.
-
#description ⇒ Object
Returns the value of attribute description.
-
#price ⇒ Object
Returns the value of attribute price.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Reward
constructor
A new instance of Reward.
- #to_hash ⇒ Object
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Reward
Returns a new instance of Reward.
6 7 8 9 10 |
# File 'lib/kickstapi/reward.rb', line 6 def initialize(attributes={}) attributes.each do |key, value| public_send("#{key}=", value) end end |
Instance Attribute Details
#backers ⇒ Object
Returns the value of attribute backers.
3 4 5 |
# File 'lib/kickstapi/reward.rb', line 3 def backers @backers end |
#delivery_date ⇒ Object
Returns the value of attribute delivery_date.
3 4 5 |
# File 'lib/kickstapi/reward.rb', line 3 def delivery_date @delivery_date end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/kickstapi/reward.rb', line 3 def description @description end |
#price ⇒ Object
Returns the value of attribute price.
3 4 5 |
# File 'lib/kickstapi/reward.rb', line 3 def price @price end |
Instance Method Details
#to_hash ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/kickstapi/reward.rb', line 13 def to_hash hash = {} self.instance_variables.each do |var| sym = var.to_s.gsub(/@/, '') hash[sym.to_sym] = self.instance_variable_get var end hash end |
#to_json(*a) ⇒ Object
22 23 24 |
# File 'lib/kickstapi/reward.rb', line 22 def to_json(*a) self.to_hash.to_json end |