Encapsulates all the information needed to make a request of Gliffy outside of request-specific information.
Methods
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 the access token if, for some reason, you know the one you have is bad.
Return a nonce that hasn’t been used before (at least not in this space/time continuum)