Class: AccessToken

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
MongoMapper::Document
Defined in:
lib/passport/support/mongo.rb,
lib/passport/support/object.rb,
lib/passport/support/active_record.rb

Direct Known Subclasses

OauthToken, OpenidToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ AccessToken

Returns a new instance of AccessToken.



4
5
6
7
8
# File 'lib/passport/support/object.rb', line 4

def initialize(attributes)
  attributes.each do |k, v|
    self.send("#{k.to_s}=", v) if self.respond_to?("#{k.to_s}=")
  end
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



2
3
4
# File 'lib/passport/support/object.rb', line 2

def key
  @key
end

#secretObject

Returns the value of attribute secret.



2
3
4
# File 'lib/passport/support/object.rb', line 2

def secret
  @secret
end

#tokenObject

Returns the value of attribute token.



2
3
4
# File 'lib/passport/support/object.rb', line 2

def token
  @token
end

Instance Method Details

#to_hashObject



10
11
12
# File 'lib/passport/support/object.rb', line 10

def to_hash
  {:token => token, :secret => secret, :key => key}
end