Class: Troo::Configuration
- Inherits:
-
Object
- Object
- Troo::Configuration
- Defined in:
- lib/troo/configuration.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.load(file, env) ⇒ Troo::Configuration
19 20 21 |
# File 'lib/troo/configuration.rb', line 19 def load(file, env) new(YAML.load_file(file)[env]) end |
Instance Method Details
#save(file, env) ⇒ TrueClass, FalseClass
27 28 29 30 31 32 |
# File 'lib/troo/configuration.rb', line 27 def save(file, env) return true if File.open(file, 'w') do |file| file.write configuration_yaml(env) end false end |
#view ⇒ String
35 36 37 38 39 |
# File 'lib/troo/configuration.rb', line 35 def view attributes.map do |label, value| Preference.view(label: label, value: value) end.join("\n") end |