Class: RD::Verbatim
- Inherits:
-
BlockElement
- Object
- Element
- BlockElement
- RD::Verbatim
- Includes:
- ListItemComposable, TerminalElement
- Defined in:
- lib/rd2odt/rdtool/rd/rd-struct.rb,
lib/rd2odt/rdtool/rd/block-element.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Attributes inherited from Element
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #each_line ⇒ Object
-
#initialize(content_strings = []) ⇒ Verbatim
constructor
A new instance of Verbatim.
Methods included from TerminalElement
Methods inherited from Element
Constructor Details
#initialize(content_strings = []) ⇒ Verbatim
Returns a new instance of Verbatim.
93 94 95 96 |
# File 'lib/rd2odt/rdtool/rd/block-element.rb', line 93 def initialize(content_strings = []) super() @content = content_strings # Array of String end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
91 92 93 |
# File 'lib/rd2odt/rdtool/rd/block-element.rb', line 91 def content @content end |
Instance Method Details
#accept(visitor) ⇒ Object
98 99 100 |
# File 'lib/rd2odt/rdtool/rd/block-element.rb', line 98 def accept(visitor) visitor.visit_Verbatim(self) end |
#each_line ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/rd2odt/rdtool/rd/block-element.rb', line 102 def each_line if @content.respond_to?(:each_line) @content.each_line {|i| yield i } else @content.each {|i| yield i } end end |