Class: Container
- Inherits:
-
Object
- Object
- Container
- Defined in:
- lib/yesroff/text.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
- #<<(content) ⇒ Object
-
#initialize(style, parent = nil, contents = []) ⇒ Container
constructor
A new instance of Container.
- #render(w) ⇒ Object
Constructor Details
#initialize(style, parent = nil, contents = []) ⇒ Container
Returns a new instance of Container.
60 61 62 63 |
# File 'lib/yesroff/text.rb', line 60 def initialize(style, parent=nil, contents=[]) @style = style @contents = contents end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
58 59 60 |
# File 'lib/yesroff/text.rb', line 58 def contents @contents end |
#parent ⇒ Object
Returns the value of attribute parent.
58 59 60 |
# File 'lib/yesroff/text.rb', line 58 def parent @parent end |
#style ⇒ Object
Returns the value of attribute style.
58 59 60 |
# File 'lib/yesroff/text.rb', line 58 def style @style end |
Instance Method Details
#<<(content) ⇒ Object
65 66 67 |
# File 'lib/yesroff/text.rb', line 65 def <<(content) @contents << content end |
#render(w) ⇒ Object
69 70 71 72 73 74 |
# File 'lib/yesroff/text.rb', line 69 def render(w) #puts "========= rendering #{self.class} size: #{contents.size}" #pp contents #puts "Rendering:" contents.each {|c| c.render(w)} end |