Module: Smartfm::ActsAsLikable
Instance Method Summary collapse
- #like!(auth, params = {}) ⇒ Object
- #likes(params = {}) ⇒ Object
- #unlike!(auth, params = {}) ⇒ Object
Instance Method Details
#like!(auth, params = {}) ⇒ Object
8 9 10 |
# File 'lib/smartfm/modules/acts_as_likable.rb', line 8 def like!(auth, params = {}) self.rest_client.like!(auth, params.merge(:id => self.id)) end |
#likes(params = {}) ⇒ Object
3 4 5 6 |
# File 'lib/smartfm/modules/acts_as_likable.rb', line 3 def likes(params = {}) hash = self.rest_client.likes(params.merge(:id => self.id)) self.deserialize(hash, :as => Smartfm::Like) || [] end |
#unlike!(auth, params = {}) ⇒ Object
12 13 14 |
# File 'lib/smartfm/modules/acts_as_likable.rb', line 12 def unlike!(auth, params = {}) self.rest_client.unlike!(auth, params.merge(:id => self.id)) end |