Class: Vaultoro::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#credentialsObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/vaultoro/configuration.rb', line 37

def credentials
  @credentials ||= {
    :production => {
      :api_key => ENV['VAULTORO_API_KEY'],
      :api_secret => ENV['VAULTORO_API_SECRET'],
      :api_uri => "https://api.vaultoro.com",
      :api_version => 1
    },
    :test => {
      :api_key => "testapi",
      :api_secret => "testpass",
      :api_uri => "https://api.vaultoro.com",
      :api_version => 1
    },
    :development => {
      :api_key => "testapi",
      :api_secret => "testpass",
      :api_uri => "https://api.vaultoro.com",
      :api_version => 1
    }
  }
end

Instance Method Details

#api_keyObject



5
6
7
# File 'lib/vaultoro/configuration.rb', line 5

def api_key
  Vaultoro.credentials[Vaultoro.environment][:api_key]
end

#api_key=(value) ⇒ Object



9
10
11
# File 'lib/vaultoro/configuration.rb', line 9

def api_key=(value)
  Vaultoro.credentials[Vaultoro.environment][:api_key] = value
end

#api_secretObject



13
14
15
# File 'lib/vaultoro/configuration.rb', line 13

def api_secret
  Vaultoro.credentials[Vaultoro.environment][:api_secret]
end

#api_secret=(value) ⇒ Object



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

def api_secret=(value)
  Vaultoro.credentials[Vaultoro.environment][:api_secret] = value
end

#api_uriObject



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

def api_uri
  Vaultoro.credentials[Vaultoro.environment][:api_uri]
end

#api_uri=(value) ⇒ Object



25
26
27
# File 'lib/vaultoro/configuration.rb', line 25

def api_uri=(value)
  Vaultoro.credentials[Vaultoro.environment][:api_uri] = value
end

#api_versionObject



29
30
31
# File 'lib/vaultoro/configuration.rb', line 29

def api_version
  Vaultoro.credentials[Vaultoro.environment][:api_version]
end

#api_version=(value) ⇒ Object



33
34
35
# File 'lib/vaultoro/configuration.rb', line 33

def api_version=(value)
  Vaultoro.credentials[Vaultoro.environment][:api_version] = value
end

#environmentObject



60
61
62
# File 'lib/vaultoro/configuration.rb', line 60

def environment
  @environment ||= :production
end

#environment=(value) ⇒ Object



64
65
66
# File 'lib/vaultoro/configuration.rb', line 64

def environment=(value)
  @environment = value.is_a?(String) ? value.to_sym : value
end

#environmentsObject



68
69
70
# File 'lib/vaultoro/configuration.rb', line 68

def environments
  Vaultoro.credentials.keys
end