Module: Asana::Config

Included in:
Asana
Defined in:
lib/asana/config.rb

Constant Summary collapse

API_VERSION =
'1.0'
DEFAULT_ENDPOINT =
"https://app.asana.com/api/#{API_VERSION}/"
USER_AGENT =
"Asana Ruby Gem #{Asana::VERSION}"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



11
12
13
# File 'lib/asana/config.rb', line 11

def api_key
  @api_key
end

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Asana::Config)

    the object that the method was called on



13
14
15
16
17
18
19
20
# File 'lib/asana/config.rb', line 13

def configure
  yield self
  Resource.site      = DEFAULT_ENDPOINT
  Resource.user      = self.api_key
  Resource.password  = ''
  Resource.format    = :json
  self
end