class Voom::Presenters::DSL::Components::Card::Media
Attributes
color[R]
components[R]
height[R]
width[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/card.rb, line 54 def initialize(**attribs_, &block) super(type: :media, **attribs_, &block) @height = attribs.delete(:height) @width = attribs.delete(:width) @color = attribs.delete(:color) @hidden = attribs.delete(:hidden) {false} @components = [] expand! end
Public Instance Methods
avatar(avatar = nil, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 79 def avatar(avatar = nil, **attribs, &block) return @avatar if locked? @avatar = Avatar.new(parent: self, avatar: avatar, **attribs, &block) end
image(image = nil, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 85 def image(image = nil, **attribs, &block) return @image if locked? @image = Image.new(parent: self, image: image, **attribs, &block) end
subtitle(*text, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 74 def subtitle(*text, **attribs, &block) return @subtitle if locked? @subtitle = Components::Typography.new(parent: self, type: :subtitle, text: text, **attribs, &block) end
title(*title, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/card.rb, line 65 def title(*title, **attribs, &block) return @title if locked? @title = Typography.new(type: :headline, level: 6, parent: self, text: title, **attribs, &block) end