Sha256: 78acd416341229c7c69300aeed3b3c8e358f393a4e893b8938d4846ae404877b

Contents?: true

Size: 619 Bytes

Versions: 5

Compression:

Stored size: 619 Bytes

Contents

module Dimelo::CCP
  module API
    module Common
      module Starrable

        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

        def unstar!
          path = "#{compute_path(attributes)}/unstar"
          response = client.transport(:put, path)
          self.attributes = Dimelo::CCP::API.decode_json(response)
          errors.empty?
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dimelo_ccp_api-0.5.0 lib/dimelo/ccp/api/common/starrable.rb
dimelo_ccp_api-0.4.4 lib/dimelo/ccp/api/common/starrable.rb
dimelo_ccp_api-0.4.3 lib/dimelo/ccp/api/common/starrable.rb
dimelo_ccp_api-0.4.2 lib/dimelo/ccp/api/common/starrable.rb
dimelo_ccp_api-0.4.1 lib/dimelo/ccp/api/common/starrable.rb