Class: RD::Verbatim

Inherits:
BlockElement show all
Includes:
ListItemComposable, TerminalElement
Defined in:
lib/rd2odt/rdtool/rd/rd-struct.rb,
lib/rd2odt/rdtool/rd/block-element.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#parent

Instance Method Summary collapse

Methods included from TerminalElement

#children, #each_element

Methods inherited from Element

#inspect, #tree

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

#contentObject (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_lineObject



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