Class: Afterburn::Authorization

Inherits:
Object
  • Object
show all
Includes:
Trello, Trello::Authorization
Defined in:
lib/afterburn/authorization.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(member_name) ⇒ Authorization

Returns a new instance of Authorization.



8
9
10
# File 'lib/afterburn/authorization.rb', line 8

def initialize(member_name)
  @member_name = member_name
end

Instance Attribute Details

#trello_app_tokenObject

Returns the value of attribute trello_app_token.



6
7
8
# File 'lib/afterburn/authorization.rb', line 6

def trello_app_token
  @trello_app_token
end

#trello_user_keyObject

Returns the value of attribute trello_user_key.



6
7
8
# File 'lib/afterburn/authorization.rb', line 6

def trello_user_key
  @trello_user_key
end

#trello_user_secretObject

Returns the value of attribute trello_user_secret.



6
7
8
# File 'lib/afterburn/authorization.rb', line 6

def trello_user_secret
  @trello_user_secret
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



12
13
14
15
16
17
18
# File 'lib/afterburn/authorization.rb', line 12

def configure
  yield self if block_given?
  Trello::Authorization.const_set :AuthPolicy, OAuthPolicy
  OAuthPolicy.consumer_credential = OAuthCredential.new trello_user_key, trello_user_secret
  OAuthPolicy.token = OAuthCredential.new trello_app_token, nil
  Afterburn::Member.add_member(member)
end

#memberObject



32
33
34
# File 'lib/afterburn/authorization.rb', line 32

def member
  Afterburn::Member.find(@member_name)
end