Module: Dimelo::CCP::API::Common::Starrable
Instance Method Summary collapse
-
#star! ⇒ Object
use method name with bang to differenciate from #star attribute.
- #unstar! ⇒ Object
Instance Method Details
#star! ⇒ Object
use method name with bang to differenciate from #star attribute
6 7 8 9 10 11 |
# File 'lib/dimelo/ccp/api/common/starrable.rb', line 6 def star! #use method name with bang to differenciate from #star attribute path = "#{compute_path(attributes)}/star" response = client.transport(:put, path) self.attributes = Dimelo::CCP::API.decode_json(response) errors.empty? end |
#unstar! ⇒ Object
13 14 15 16 17 18 |
# File 'lib/dimelo/ccp/api/common/starrable.rb', line 13 def unstar! path = "#{compute_path(attributes)}/unstar" response = client.transport(:put, path) self.attributes = Dimelo::CCP::API.decode_json(response) errors.empty? end |