Class: RubyHome::BoolValue

Inherits:
BaseValue show all
Defined in:
lib/ruby_home/hap/values/bool_value.rb

Constant Summary collapse

REMAPPED_VALUES =
{
  '0' => false,
  0 => false,
  '1' => true,
  1 => true,
}.freeze

Instance Attribute Summary

Attributes inherited from BaseValue

#value

Instance Method Summary collapse

Methods inherited from BaseValue

#initialize, value_for_template

Constructor Details

This class inherits a constructor from RubyHome::BaseValue

Instance Method Details

#defaultObject



12
13
14
# File 'lib/ruby_home/hap/values/bool_value.rb', line 12

def default
  false
end

#value=(new_value) ⇒ Object



16
17
18
# File 'lib/ruby_home/hap/values/bool_value.rb', line 16

def value=(new_value)
  @value = REMAPPED_VALUES.fetch(new_value, new_value)
end