class Voom::Presenters::DSL::Components::Card
Attributes
background_color[R]
components[R]
height[R]
padding[R]
selected[R]
shows_errors[R]
width[R]
Public Class Methods
new(**attribs_, &block)
click to toggle source
Calls superclass method
# File lib/voom/presenters/dsl/components/card.rb, line 27 def initialize(**attribs_, &block) super(type: :card, **attribs_, &block) @height = attribs.delete(:height) @width = attribs.delete(:width) @selected = attribs.delete(:selected) {false} self.text(attribs.delete(:text)) if attribs.key?(:text) @shows_errors = attribs.delete(:shows_errors) {true} padding = attribs.delete(:padding) {:all} @padding = validate_padding(coerce_padding(padding)).uniq if padding != nil @hidden = attribs.delete(:hidden){false} @background_color = attribs.delete(:background_color) @components = [] expand! end
Public Instance Methods
actions(**attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 101 def actions(**attribs, &block) return @actions if locked? @actions = Actions.new(parent: self, **attribs, &block) end
media(**attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 43 def media(**attribs, &block) return @media if locked? @media = Media.new(parent: self, **attribs, &block) end
text(*text, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 96 def text(*text, **attribs, &block) self << Typography.new(type: :body, parent: self, text: text, **attribs, &block) end