Class: WishSimple::User
Constant Summary collapse
- ATTRS =
[:facebook_uid, :access_token]
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(facebook_uid, access_token = nil) ⇒ User
constructor
A new instance of User.
-
#purchase!(product) ⇒ Object
Actions.
Methods inherited from Resource
Constructor Details
#initialize(facebook_uid, access_token = nil) ⇒ User
Returns a new instance of User.
8 9 10 11 |
# File 'lib/wishsimple/user.rb', line 8 def initialize(facebook_uid, access_token=nil) self.facebook_uid = facebook_uid self.access_token = access_token end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 |
# File 'lib/wishsimple/user.rb', line 13 def ==(other) super || (other.class == self.class && other.facebook_uid == self.facebook_uid) end |
#purchase!(product) ⇒ Object
Actions
18 19 20 |
# File 'lib/wishsimple/user.rb', line 18 def purchase!(product) WishSimple::Purchase.create(user: self, product: product) end |