module Voom::Presenters::DSL::Components::Menu::BaseMenuItem

Constants

VALID_POSITIONS
VALID_SIZES

Attributes

color[R]
position[R]
size[R]

Private Instance Methods

validate_position(value) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 47
def validate_position(value)
  return unless value

  v = value.to_sym

  unless VALID_POSITIONS.include?(v)
    raise Errors::ParameterValidation,
          "Invalid item position! Valid positions include #{VALID_POSITIONS.join(', ')}"
  end

  v
end
validate_size(value) click to toggle source
# File lib/voom/presenters/dsl/components/menu.rb, line 60
def validate_size(value)
  return unless value

  v = value.to_sym

  unless VALID_SIZES.include?(v)
    raise Errors::ParameterValidation,
          "Invalid item size! Valid sizes include #{VALID_SIZES.join(', ')}"
  end

  v
end