class SimpleDesk::Configuration

Constants

ALLOWED_ENVS
ENV_URLS

Attributes

token[W]

Public Instance Methods

env() click to toggle source
# File lib/simple_desk/configuration.rb, line 10
def env
  @env || :sandbox
end
env=(env_sym) click to toggle source
# File lib/simple_desk/configuration.rb, line 18
def env=(env_sym)
  if ALLOWED_ENVS.include?(env_sym.to_s)
    @env = env_sym.to_s
  else
    raise SimpleDesk::ConfigurationError.new("You attempted to set Simpledesk env to #{env_sym}. Should be one of #{env_choices}")
  end
end
token() click to toggle source
# File lib/simple_desk/configuration.rb, line 14
def token
  @token || raise(SimpleDesk::ConfigurationError.new('You need to set your token, see SimpleDesk Readme'))
end

Private Instance Methods

env_choices() click to toggle source
# File lib/simple_desk/configuration.rb, line 28
def env_choices
  (ALLOWED_ENVS - ['local']).join(', ')
end