Class: SpeakingApps::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/speaking_apps/config.rb

Overview

Use SpeakingApps::Config to setup your SpeakingApps.com API access.

Please note: You must set the token in order to use the API. Don’t know your token? Login to your account on youraccount.speakingapps.com (or get a new one), select your project and open ‘Settings’.

Place the configuration wherever you want. In a Rails app you would typically add these lines under config/environment or config/initializers/.

Class Method Summary collapse

Class Method Details

.clear!Object

:nodoc:



52
53
54
55
56
# File 'lib/speaking_apps/config.rb', line 52

def self.clear! #:nodoc:
  class_variables.each do |v|
    remove_class_variable v.intern rescue true
  end
end

.environmentsObject

:nodoc:



32
33
34
# File 'lib/speaking_apps/config.rb', line 32

def self.environments #:nodoc:
  class_variable_defined?(:@@_environments) ? @@_environments : ['production']
end

.environments=(new_environments) ⇒ Object

Set the environment(s) in which SpeakingApps#log should be active. Defaults to: [‘production’]

SpeakingApps::Config.environments = ['staging', 'production']



28
29
30
# File 'lib/speaking_apps/config.rb', line 28

def self.environments=(new_environments)
  @@_environments = new_environments
end

.hostObject

:nodoc:



40
41
42
# File 'lib/speaking_apps/config.rb', line 40

def self.host #:nodoc:
  class_variable_defined?(:@@_host) ? @@_host : 'speakingapps.com'
end

.host=(new_host) ⇒ Object

:nodoc:



36
37
38
# File 'lib/speaking_apps/config.rb', line 36

def self.host=(new_host) #:nodoc:
  @@_host = new_host
end

.portObject

:nodoc:



48
49
50
# File 'lib/speaking_apps/config.rb', line 48

def self.port #:nodoc:
  class_variable_defined?(:@@_host) ? @@_port : '80'
end

.port=(new_port) ⇒ Object

:nodoc:



44
45
46
# File 'lib/speaking_apps/config.rb', line 44

def self.port=(new_port) #:nodoc:
  @@_port = new_port
end

.tokenObject

:nodoc:



21
22
23
# File 'lib/speaking_apps/config.rb', line 21

def self.token  #:nodoc:
  class_variable_defined?(:@@_token) ? @@_token : nil
end

.token=(new_token) ⇒ Object

Configure which Project-Token to use.

SpeakingApps::Config.token = 'your-api-token'



17
18
19
# File 'lib/speaking_apps/config.rb', line 17

def self.token=(new_token)
  @@_token = new_token
end