Class: Voom::Presenters::DSL::Components::Card
- Defined in:
- lib/voom/presenters/dsl/components/card.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#selected ⇒ Object
readonly
Returns the value of attribute selected.
-
#shows_errors ⇒ Object
readonly
Returns the value of attribute shows_errors.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
- #actions(**attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ Card
constructor
A new instance of Card.
- #media(**attribs, &block) ⇒ Object
- #text(*text, **attribs, &block) ⇒ Object
Methods included from Mixins::Snackbars
Methods included from Mixins::Icons
Methods included from Mixins::TextFields
#datetime_field, #hidden_field, #text_area, #text_field
Methods included from Mixins::Attaches
Methods included from Mixins::Common
#badge, #card, #form, #list, #table
Methods included from Mixins::Menus
Methods included from Mixins::Content
Methods included from Mixins::ExpansionPanels
Methods included from Mixins::Buttons
Methods included from Mixins::Grids
Methods included from Mixins::Typography
#body, #display, #headline, #subheading, #title
Methods included from Mixins::Append
Methods included from Mixins::Toggles
#checkbox, #icon_toggle, #radio_button, #switch
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Card
Returns a new instance of Card.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 25 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} @components = [] end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
22 23 24 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 22 def components @components end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
22 23 24 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 22 def height @height end |
#selected ⇒ Object (readonly)
Returns the value of attribute selected.
22 23 24 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 22 def selected @selected end |
#shows_errors ⇒ Object (readonly)
Returns the value of attribute shows_errors.
22 23 24 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 22 def shows_errors @shows_errors end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
22 23 24 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 22 def width @width end |
Instance Method Details
#actions(**attribs, &block) ⇒ Object
93 94 95 96 97 98 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 93 def actions(**attribs, &block) return @actions if locked? @actions = Actions.new(parent: self, context: context, **attribs, &block) end |
#media(**attribs, &block) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 37 def media(**attribs, &block) return @media if locked? @media = Media.new(parent: self, context: context, **attribs, &block) end |
#text(*text, **attribs, &block) ⇒ Object
88 89 90 91 |
# File 'lib/voom/presenters/dsl/components/card.rb', line 88 def text(*text, **attribs, &block) self << Typography.new(type: :body, parent: self, text: text, context: context, **attribs, &block) end |