Class: WhenIWork::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/wheniwork/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
# File 'lib/wheniwork/configuration.rb', line 6

def initialize
  setup_base
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def api_key
  @api_key
end

#api_versionObject

Returns the value of attribute api_version.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def api_version
  @api_version
end

#cache_enabledObject

Returns the value of attribute cache_enabled.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def cache_enabled
  @cache_enabled
end

#cache_storeObject

Returns the value of attribute cache_store.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def cache_store
  @cache_store
end

#endpointObject

Returns the value of attribute endpoint.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def endpoint
  @endpoint
end

#expires_inObject

Returns the value of attribute expires_in.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def expires_in
  @expires_in
end

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def password
  @password
end

#protocolObject

Returns the value of attribute protocol.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def protocol
  @protocol
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/wheniwork/configuration.rb', line 3

def username
  @username
end

Instance Method Details

#setup_baseObject



10
11
12
13
14
15
16
17
# File 'lib/wheniwork/configuration.rb', line 10

def setup_base
  self.api_version   = '2'
  self.protocol      = 'https'
  self.cache_enabled = true
  self.cache_store   = ActiveSupport::Cache::MemoryStore.new
  self.endpoint      = "#{protocol}://api.wheniwork.com/#{api_version}/"
  self.expires_in    = 60
end