Class: Rubord::Components::Separator
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Rubord::Components::Separator
- Defined in:
- lib/rubord/components/containers/separator.rb
Constant Summary collapse
- SPACING =
{ small: 1, large: 2 }.freeze
Instance Attribute Summary collapse
-
#divider ⇒ Object
readonly
Returns the value of attribute divider.
-
#spacing ⇒ Object
readonly
Returns the value of attribute spacing.
Attributes inherited from BaseComponent
Instance Method Summary collapse
-
#initialize(divider: true, spacing: :small) ⇒ Separator
constructor
A new instance of Separator.
- #to_h ⇒ Object
Constructor Details
#initialize(divider: true, spacing: :small) ⇒ Separator
Returns a new instance of Separator.
13 14 15 16 17 18 |
# File 'lib/rubord/components/containers/separator.rb', line 13 def initialize(divider: true, spacing: :small) super(14) @divider = !!divider @spacing = parse_spacing(spacing) end |
Instance Attribute Details
#divider ⇒ Object (readonly)
Returns the value of attribute divider.
11 12 13 |
# File 'lib/rubord/components/containers/separator.rb', line 11 def divider @divider end |
#spacing ⇒ Object (readonly)
Returns the value of attribute spacing.
11 12 13 |
# File 'lib/rubord/components/containers/separator.rb', line 11 def spacing @spacing end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/rubord/components/containers/separator.rb', line 20 def to_h { type: @type, divider: @divider, spacing: @spacing } end |