class Voom::Presenters::DSL::Components::Progress
Attributes
position[R]
Public Class Methods
new(**attribs_, &block)
click to toggle source
Calls superclass method
Voom::Presenters::DSL::Components::Base::new
# File lib/voom/presenters/dsl/components/progress.rb, line 8 def initialize(**attribs_, &block) super(type: :progress, **attribs_, &block) @hidden = attribs.delete(:hidden) {true} @position = attribs.delete(:position) {:top} validate_position(@position) end
Private Instance Methods
validate_position(position)
click to toggle source
# File lib/voom/presenters/dsl/components/progress.rb, line 17 def validate_position(position) unless (Array(position) - %i(top bottom both)).empty? raise(Errors::ParameterValidation, "Position (#{position}) must be either :top, :bottom or :both") end end