Method: Config#save_temperature
- Defined in:
- lib/config.rb
#save_temperature(temperature) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/config.rb', line 26 def save_temperature(temperature) config = YAML.load_file(config_path) if config == false config = {} end config['TEMPERATURE'] = temperature.to_f File.open(config_path, 'w') { |f| YAML.dump(config, f) } end |