Class: ProconBypassMan::ButtonsSettingConfiguration::ParamNormalizer::FlipIfPressed
- Inherits:
-
Object
- Object
- ProconBypassMan::ButtonsSettingConfiguration::ParamNormalizer::FlipIfPressed
- Defined in:
- lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/flip_if_pressed.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, button:) ⇒ FlipIfPressed
constructor
A new instance of FlipIfPressed.
- #to_value! ⇒ Object
Constructor Details
#initialize(value, button:) ⇒ FlipIfPressed
Returns a new instance of FlipIfPressed.
7 8 9 10 |
# File 'lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/flip_if_pressed.rb', line 7 def initialize(value, button: ) @value = value @button = end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/flip_if_pressed.rb', line 5 def value @value end |
Instance Method Details
#to_value! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/flip_if_pressed.rb', line 12 def to_value! case value when Integer raise UnSupportValueError when TrueClass return [@button] when Symbol, String return [value.to_sym] when Array return value.map(&:to_sym).uniq when FalseClass, NilClass return false else raise UnexpectedValueError end end |