Class: Shoes::Span
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Text
#color, #parent, #text_block, #texts, #to_s
Instance Method Summary collapse
-
#initialize(texts, styles = {}) ⇒ Span
constructor
A new instance of Span.
- #style ⇒ Object
Methods inherited from Text
Methods included from Common::LinkFinder
Methods included from Common::Inspect
Constructor Details
#initialize(texts, styles = {}) ⇒ Span
Returns a new instance of Span.
5 6 7 8 |
# File 'shoes-core/lib/shoes/span.rb', line 5 def initialize(texts, styles = {}) @style = styles super texts, styles.delete(:color) end |
Instance Method Details
#style ⇒ Object
10 11 12 13 14 15 16 |
# File 'shoes-core/lib/shoes/span.rb', line 10 def style if @parent && @parent.respond_to?(:style) @parent.style.merge(@style) else @style end end |