Class: Shoes::Span

Inherits:
Text
  • Object
show all
Defined in:
shoes-core/lib/shoes/span.rb

Direct Known Subclasses

Link

Instance Attribute Summary

Attributes inherited from Text

#color, #parent, #text_block, #texts, #to_s

Instance Method Summary collapse

Methods inherited from Text

#app, #links

Methods included from Common::LinkFinder

#find_links

Methods included from Common::Inspect

#inspect, #to_s

Constructor Details

#initialize(texts, styles = {}) ⇒ 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

#styleObject


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