Class: James::Bond
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- James::Bond
- Defined in:
- lib/james/bond.rb,
lib/james/bond/settings.rb
Direct Known Subclasses
Class Method Summary collapse
-
.root_path(*args) ⇒ Object
Helper method for file references.
-
.settings(key) ⇒ Object
TODO Add documentation.
Instance Method Summary collapse
Class Method Details
.root_path(*args) ⇒ Object
Helper method for file references.
13 14 15 |
# File 'lib/james/bond.rb', line 13 def self.root_path(*args) File.join(James.root, *args) end |
.settings(key) ⇒ Object
TODO Add documentation.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/james/bond/settings.rb', line 6 def self.settings(key) @settings ||= YAML.load_file(root_path("config", "settings.yml"))[RACK_ENV.to_sym] unless @settings.include?(key) = "No setting defined for #{key.inspect}." defined?(logger) ? logger.warn() : $stderr.puts() end @settings[key] end |
Instance Method Details
#root_path(*args) ⇒ Object
18 19 20 |
# File 'lib/james/bond.rb', line 18 def root_path(*args) self.class.root_path(*args) end |
#settings(key) ⇒ Object
17 18 19 |
# File 'lib/james/bond/settings.rb', line 17 def settings(key) self.class.settings(key) end |