Encapsulates all the information needed to make a request of Gliffy outside of request-specific information.

Methods
C
H
N
U
Attributes
[R] consumer_key
[R] consumer_secret
[R] access_token
[R] username
[R] account_id
[R] description
[R] default_protocol
Class Public methods
new(consumer_key, consumer_secret, description, account_id, username, default_protocol=:http, access_token = nil)

Create a new Credentials object.

consumer_key
The OAuth consumer key given to you when you signed up
consumer_secret
The OAuth consumer secret given to you when you signed up
description
Description of the application you are writing
account_id
Your account id
username
the Gliffy user name/identifier
access_token
The access token you were given as a AccessToken, or nil if you don’t have one yet.
# File lib/gliffy/credentials.rb, line 41
    def initialize(consumer_key, consumer_secret, description, account_id, username, default_protocol=:http, access_token = nil)
      raise ArgumentError.new("consumer_key required") if consumer_key.nil?
      raise ArgumentError.new("consumer_secret required") if consumer_secret.nil?
      raise ArgumentError.new("description required") if description.nil? || description.strip == ''
      raise ArgumentError.new("account_id required") if account_id.nil?
      raise ArgumentError.new("username required") if username.nil?

      @consumer_key = consumer_key
      @consumer_secret = consumer_secret
      @username = username
      @access_token = access_token
      @description = description
      @account_id = account_id
      @default_protocol = default_protocol
    end
Instance Public methods
clear_access_token()

Clear the access token if, for some reason, you know the one you have is bad.

# File lib/gliffy/credentials.rb, line 69
    def clear_access_token
      update_access_token(nil)
    end
has_access_token?()
# File lib/gliffy/credentials.rb, line 57
    def has_access_token?
      !@access_token.nil?
    end
nonce()

Return a nonce that hasn’t been used before (at least not in this space/time continuum)

# File lib/gliffy/credentials.rb, line 74
    def nonce
      Time.now.to_f.to_s
    end
update_access_token(token)

Update the access token

# File lib/gliffy/credentials.rb, line 62
    def update_access_token(token)
      @access_token = token
      @access_token
    end