Class: RubyUI::Separator
- Defined in:
- lib/ruby_ui/separator/separator.rb
Constant Summary collapse
- ORIENTATIONS =
%i[horizontal vertical].freeze
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(as: :div, orientation: :horizontal, decorative: true, **attrs) ⇒ Separator
constructor
A new instance of Separator.
- #view_template ⇒ Object
Constructor Details
#initialize(as: :div, orientation: :horizontal, decorative: true, **attrs) ⇒ Separator
Returns a new instance of Separator.
7 8 9 10 11 12 13 14 |
# File 'lib/ruby_ui/separator/separator.rb', line 7 def initialize(as: :div, orientation: :horizontal, decorative: true, **attrs) raise ArgumentError, "Invalid orientation: #{orientation}" unless ORIENTATIONS.include?(orientation.to_sym) @as = as @orientation = orientation.to_sym @decorative = decorative super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
16 17 18 |
# File 'lib/ruby_ui/separator/separator.rb', line 16 def view_template(&) tag(@as, **attrs, &) end |