Sha256: 602e1cc695ee860e4738be3e14b58037568de40a0ce10573fdf6031b2efb4c66

Contents?: true

Size: 529 Bytes

Versions: 8

Compression:

Stored size: 529 Bytes

Contents

module Flattr
  module Authenticatable
    # Credentials hash
    #
    # @return [Hash]
    def credentials
      {
        :client_id     => client_id,
        :client_secret => client_secret,
        :access_token  => access_token,
      }
    end

    # Check whether credentials are present
    #
    # @return [Boolean]
    def credentials?
      if credentials[:access_token]
        true
      elsif credentials[:client_id] && credentials[:client_secret]
        true
      else
        false
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
flattr-0.3.7 lib/flattr/authenticatable.rb
flattr-0.3.6 lib/flattr/authenticatable.rb
flattr-0.3.5 lib/flattr/authenticatable.rb
flattr-0.3.4 lib/flattr/authenticatable.rb
flattr-0.3.3 lib/flattr/authenticatable.rb
flattr-0.3.2 lib/flattr/authenticatable.rb
flattr-0.3.1 lib/flattr/authenticatable.rb
flattr-0.3.0 lib/flattr/authenticatable.rb