Class: Nervion::Configuration

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

Constant Summary collapse

UNCONFIGURED_SETTING =
''

Class Method Summary collapse

Class Method Details

.[](setting) ⇒ Object



58
59
60
# File 'lib/nervion/configuration.rb', line 58

def self.[](setting)
  fetch setting
end

.access_tokenObject



43
44
45
# File 'lib/nervion/configuration.rb', line 43

def self.access_token
  @access_token || UNCONFIGURED_SETTING
end

.access_token=(access_token) ⇒ Object

Configures the access token

Parameters:

  • access_token (String)

    the access token



39
40
41
# File 'lib/nervion/configuration.rb', line 39

def self.access_token=(access_token)
  @access_token = access_token
end

.access_token_secretObject



54
55
56
# File 'lib/nervion/configuration.rb', line 54

def self.access_token_secret
  @access_token_secret || UNCONFIGURED_SETTING
end

.access_token_secret=(access_token_secret) ⇒ Object

Configures the access token secret

Parameters:

  • access_token_secret (String)

    the access token secret



50
51
52
# File 'lib/nervion/configuration.rb', line 50

def self.access_token_secret=(access_token_secret)
  @access_token_secret = access_token_secret
end

.configured!Object



70
71
72
# File 'lib/nervion/configuration.rb', line 70

def self.configured!
  @configured = true
end

.configured?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/nervion/configuration.rb', line 66

def self.configured?
  @configured
end

.consumer_keyObject



21
22
23
# File 'lib/nervion/configuration.rb', line 21

def self.consumer_key
  @consumer_key || UNCONFIGURED_SETTING
end

.consumer_key=(consumer_key) ⇒ Object

Configures the consumer key

Parameters:

  • consumer_key (String)

    the consumer key



17
18
19
# File 'lib/nervion/configuration.rb', line 17

def self.consumer_key=(consumer_key)
  @consumer_key = consumer_key
end

.consumer_secretObject



32
33
34
# File 'lib/nervion/configuration.rb', line 32

def self.consumer_secret
  @consumer_secret || UNCONFIGURED_SETTING
end

.consumer_secret=(consumer_secret) ⇒ Object

Configures the consumer secret

Parameters:

  • consumer_secret (String)

    the consumer secret



28
29
30
# File 'lib/nervion/configuration.rb', line 28

def self.consumer_secret=(consumer_secret)
  @consumer_secret = consumer_secret
end

.fetch(setting) ⇒ Object



62
63
64
# File 'lib/nervion/configuration.rb', line 62

def self.fetch(setting)
  send setting.to_sym
end