Sha256: d7bd4635b68942f3d672798ec5f31b68d3a5027df80519f7c89d3b26564eda24

Contents?: true

Size: 670 Bytes

Versions: 21

Compression:

Stored size: 670 Bytes

Contents

module ProconBypassMan
  class ButtonsSettingConfiguration
    module ParamNormalizer
      class Button
        attr_reader :button

        def initialize(button)
          @button = button
        end

        def to_value!
          case button
          when TrueClass, FalseClass, NilClass, Array, Integer
            raise UnSupportValueError
          when Symbol, String
            unless !!ProconBypassMan::Procon::ButtonCollection::BUTTONS_MAP[button.to_sym]
              raise UnexpectedValueError
            end

            return button.to_sym
          else
            raise UnexpectedValueError
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.5 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.4 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.3.1 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.3 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.2 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.1 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.3.0 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.2.3 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.2.2 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.2.1 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.2.0 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb
procon_bypass_man-0.1.23 lib/procon_bypass_man/buttons_setting_configuration/param_normalizer/button.rb