Class: WishSimple::Action
Direct Known Subclasses
Constant Summary
Constants inherited from Resource
Instance Attribute Summary collapse
-
#product ⇒ Object
Returns the value of attribute product.
-
#user ⇒ Object
Returns the value of attribute user.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(attrs = {}) ⇒ Action
constructor
A new instance of Action.
Methods inherited from Resource
Constructor Details
#initialize(attrs = {}) ⇒ Action
Returns a new instance of Action.
11 12 13 14 |
# File 'lib/wishsimple/action.rb', line 11 def initialize(attrs={}) self.user = attrs[:user] self.product = attrs[:product] end |
Instance Attribute Details
#product ⇒ Object
Returns the value of attribute product.
5 6 7 |
# File 'lib/wishsimple/action.rb', line 5 def product @product end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'lib/wishsimple/action.rb', line 5 def user @user end |
Class Method Details
.verb ⇒ Object
7 8 9 |
# File 'lib/wishsimple/action.rb', line 7 def self.verb name.split('::')[-1].downcase.to_sym end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/wishsimple/action.rb', line 16 def ==(other) super || ( other.class == self.class \ && other.user == self.user \ && other.product == self.product ) end |