Class: Voom::Presenters::DSL::Components::Typography
- Includes:
- Mixins::Tooltips
- Defined in:
- lib/voom/presenters/dsl/components/typography.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#level ⇒ Object
Returns the value of attribute level.
-
#position ⇒ Object
Returns the value of attribute position.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
-
#initialize(parent:, **attribs_, &block) ⇒ Typography
constructor
A new instance of Typography.
Methods included from Mixins::Tooltips
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(parent:, **attribs_, &block) ⇒ Typography
Returns a new instance of Typography.
13 14 15 16 17 18 19 20 |
# File 'lib/voom/presenters/dsl/components/typography.rb', line 13 def initialize(parent:, **attribs_, &block) super(type: :text, parent: parent, **attribs_, &block) @text = Array(attribs.delete(:text)||'').flatten.join("\n\n").split("\n\n") @level = attribs.delete(:level){1} @color = attribs.delete(:color) @position = Array(attribs.delete(:position)).compact end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
11 12 13 |
# File 'lib/voom/presenters/dsl/components/typography.rb', line 11 def color @color end |
#level ⇒ Object
Returns the value of attribute level.
11 12 13 |
# File 'lib/voom/presenters/dsl/components/typography.rb', line 11 def level @level end |
#position ⇒ Object
Returns the value of attribute position.
11 12 13 |
# File 'lib/voom/presenters/dsl/components/typography.rb', line 11 def position @position end |
#text ⇒ Object
Returns the value of attribute text.
11 12 13 |
# File 'lib/voom/presenters/dsl/components/typography.rb', line 11 def text @text end |