Class: LocalCDN::Config
- Inherits:
-
Object
- Object
- LocalCDN::Config
- Defined in:
- lib/config.rb
Instance Attribute Summary collapse
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
Instance Method Summary collapse
- #file_path(local_or_remote) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
5 6 7 8 9 10 11 |
# File 'lib/config.rb', line 5 def initialize @urls = {} @urls[:remote] = YAML.load_file(file_path(:remote)) if File.exist?(f = file_path(:local)) @urls[:local] = YAML.load_file(f) end end |
Instance Attribute Details
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
3 4 5 |
# File 'lib/config.rb', line 3 def urls @urls end |
Instance Method Details
#file_path(local_or_remote) ⇒ Object
13 14 15 |
# File 'lib/config.rb', line 13 def file_path(local_or_remote) File.join Rails.root, "config", "cdn.#{local_or_remote}.yml" end |