class Juno::Configuration
Constants
- ENDPOINTS
- POSSIBLES_ENVIRONMENTS
Attributes
client_id[RW]
client_secret[RW]
private_token[RW]
Public Class Methods
new()
click to toggle source
# File lib/juno/configuration.rb, line 11 def initialize @environment = POSSIBLES_ENVIRONMENTS.first end
Public Instance Methods
endpoint_for(type)
click to toggle source
# File lib/juno/configuration.rb, line 15 def endpoint_for(type) ENDPOINTS.dig(@environment, type) end
environment=(environment)
click to toggle source
# File lib/juno/configuration.rb, line 19 def environment=(environment) raise ArgumentError, "environment #{environment} is not valid" unless valid_environment?(environment) @environment = environment end
Private Instance Methods
base_endpoint()
click to toggle source
# File lib/juno/configuration.rb, line 38 def base_endpoint ENDPOINTS[@environment] end
valid_environment?(environment)
click to toggle source
# File lib/juno/configuration.rb, line 42 def valid_environment?(environment) POSSIBLES_ENVIRONMENTS.include?(environment.to_sym) end