Class: Html::Composite
Overview
Class for compositing nested tags togther and using them multiple times in different contexts.
Instance Method Summary collapse
- #<<(other) ⇒ Object
-
#initialize(first, second) ⇒ Composite
constructor
A new instance of Composite.
Constructor Details
#initialize(first, second) ⇒ Composite
Returns a new instance of Composite.
89 90 91 92 |
# File 'lib/html/base.rb', line 89 def initialize(first, second) @first = first @second = second end |
Instance Method Details
#<<(other) ⇒ Object
94 95 96 97 98 99 100 |
# File 'lib/html/base.rb', line 94 def << (other) if other.is_a?(String) @first << (@second << other) else Composite.new(self, other) end end |