Class: Voom::Presenters::DSL::Components::Card::Media
- Includes:
- Mixins::Attaches, Mixins::Common
- Defined in:
- lib/voom/presenters/dsl/components/card.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#hidden ⇒ Object
readonly
Returns the value of attribute hidden.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #avatar(avatar = nil, **attribs, &block) ⇒ Object
- #button(icon = nil, **attributes, &block) ⇒ Object
- #image(image = nil, **attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ Media
constructor
A new instance of Media.
- #subtitle(*text, **attribs, &block) ⇒ Object
- #title(*title, **attribs, &block) ⇒ Object
Methods included from Mixins::Common
#badge, #card, #form, #list, #table, #unordered_list
Methods included from Mixins::Tables
Methods included from Mixins::Dialogs
Methods included from Mixins::ImageLists
Methods included from Mixins::Icons
Methods included from Mixins::TabBars
Methods included from Mixins::Menus
Methods included from Mixins::Content
Methods included from Mixins::ExpansionPanels
Methods included from Mixins::Grids
Methods included from Mixins::Typography
#blank, #body, #body2, #caption, #headline, #headline1, #headline2, #headline3, #headline4, #headline5, #headline6, #link, #overline, #page_title, #separator, #subtitle2, #text
Methods included from Mixins::Append
Methods included from Mixins::Toggles
#checkbox, #icon_toggle, #radio_button, #switch
Methods included from Mixins::Attaches
Methods included from Namespace
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Media
Returns a new instance of Media.
54 55 56 57 58 59 60 61 62 63 |
# 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 = [] end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
52 53 54 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 52 def color @color end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
52 53 54 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 52 def components @components end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
52 53 54 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 52 def height @height end |
#hidden ⇒ Object (readonly)
Returns the value of attribute hidden.
52 53 54 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 52 def hidden @hidden end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
52 53 54 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 52 def width @width end |
Instance Method Details
#avatar(avatar = nil, **attribs, &block) ⇒ Object
79 80 81 82 83 |
# 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 |
#button(icon = nil, **attributes, &block) ⇒ Object
90 91 92 93 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 90 def (icon = nil, **attributes, &block) return @button if locked? @button = Components::Button.new(icon: icon, position: [:top, :right], parent: self, **attributes, &block) end |
#image(image = nil, **attribs, &block) ⇒ Object
85 86 87 88 |
# 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) ⇒ Object
74 75 76 77 |
# 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) ⇒ Object
65 66 67 68 69 70 71 72 |
# 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 |