Sha256: 14f6ef546554b057cf171ea7505c58a7b956ca4683240a48f01c891d5846df0f

Contents?: true

Size: 911 Bytes

Versions: 12

Compression:

Stored size: 911 Bytes

Contents

module Coprl
  module Presenters
    module DSL
      module Components
        class Chipset < EventBase
          include Mixins::Chips
          attr_reader :variant, :components

          VALID_VARIANTS = %i[choice filter input].freeze

          def initialize(chipset_variant = nil, **attribs_, &block)
            super(type: :chipset, **attribs_, &block)
            @variant = validate_variant(chipset_variant)
            @components = []
            expand!
          end

          private

          def validate_variant(chipset_variant)
            return unless chipset_variant
            chipset_variant = chipset_variant.to_sym
            unless VALID_VARIANTS.include?(chipset_variant)
              raise Errors::ParameterValidation, "Invalid chipset variant specified: #{chipset_variant}"
            end
            chipset_variant
          end

        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.11 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.10 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.9 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.8 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.7 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.6 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.5 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.4 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.3 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.2 lib/coprl/presenters/dsl/components/chipset.rb
coprl-3.0.0.beta.1 lib/coprl/presenters/dsl/components/chipset.rb