Class: Alula::Oauth::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/alula/oauth.rb

Overview

Simple Oauth::Response reader object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Response

Returns a new instance of Response.



94
95
96
97
98
99
100
101
102
103
# File 'lib/alula/oauth.rb', line 94

def initialize(attributes)
  @raw_response = attributes

  @token_type = attributes['token_type']
  @access_token = attributes['access_token']
  @expires_in = attributes['expires_in']
  @expires_at = Time.now + @expires_in
  @refresh_token = attributes['refresh_token']
  @scope = attributes['scope']
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



92
93
94
# File 'lib/alula/oauth.rb', line 92

def access_token
  @access_token
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



92
93
94
# File 'lib/alula/oauth.rb', line 92

def expires_at
  @expires_at
end

#expires_inObject (readonly)

Returns the value of attribute expires_in.



92
93
94
# File 'lib/alula/oauth.rb', line 92

def expires_in
  @expires_in
end

#refresh_tokenObject (readonly)

Returns the value of attribute refresh_token.



92
93
94
# File 'lib/alula/oauth.rb', line 92

def refresh_token
  @refresh_token
end

#scopeObject (readonly)

Returns the value of attribute scope.



92
93
94
# File 'lib/alula/oauth.rb', line 92

def scope
  @scope
end

#token_typeObject (readonly)

Returns the value of attribute token_type.



92
93
94
# File 'lib/alula/oauth.rb', line 92

def token_type
  @token_type
end