Module: Appboard::Bootstrap

Included in:
Appboard
Defined in:
lib/appboard/bootstrap.rb

Instance Method Summary collapse

Instance Method Details

#default_settingsObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/appboard/bootstrap.rb', line 3

def default_settings
  url = URI.parse(ENV["APPBOARD_API_URL"] || 'http://api.appboard.me')
  apiKey = ENV["APPBOARD_API_KEY"]

  {
    :url => url,
    :apiKey => apiKey,
:version => 'v1',
    :logging => false,
:debug => false
  }
rescue Object => e
  raise "invalid APPBOARD_API_URL: (#{url.inspect}) #{e.class} -> #{e.message}"
end

#settingsObject



18
19
20
# File 'lib/appboard/bootstrap.rb', line 18

def settings
  @@settings ||= default_settings
end

#settings=(settings_hash) ⇒ Object



22
23
24
# File 'lib/appboard/bootstrap.rb', line 22

def settings=(settings_hash)
  @@settings = default_settings.update(settings_hash)
end