Class: ProconBypassMan::ButtonsSettingConfiguration::ParamNormalizer::OpenMacroSteps

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(steps) ⇒ OpenMacroSteps

Returns a new instance of OpenMacroSteps.



7
8
9
# File 'lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb', line 7

def initialize(steps)
  @steps = steps
end

Instance Attribute Details

#stepsObject (readonly)

Returns the value of attribute steps.



5
6
7
# File 'lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb', line 5

def steps
  @steps
end

Instance Method Details

#to_value!Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/open_macro_steps.rb', line 11

def to_value!
  case steps
  when Integer, TrueClass, FalseClass, NilClass
    raise UnSupportValueError
  when String, Symbol
    return [steps.to_sym]
  when Array
    return steps.map(&:to_sym)
  else
    raise UnexpectedValueError
  end
end