class Voom::Presenters::DSL::Components::Header
Constants
- VALID_PLACEMENTS
Attributes
image[RW]
placement[RW]
title[RW]
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/header.rb, line 10 def initialize(**attribs_, &block) super(type: :header, **attribs_, &block) self.title(attribs.delete(:title)) if attribs.key?(:title) @image = attribs.delete(:image) @placement = validate_placement(attribs.delete(:placement) { :static }) expand! end
Public Instance Methods
Private Instance Methods
validate_placement(value)
click to toggle source
# File lib/voom/presenters/dsl/components/header.rb, line 43 def validate_placement(value) return unless value placement = value.to_sym unless VALID_PLACEMENTS.include?(placement) raise Errors::ParameterValidation, "Invalid placement specified: #{placement}" end placement end