Class: Logue::ElementLines
- Inherits:
-
Object
- Object
- Logue::ElementLines
- Defined in:
- lib/logue/elements/element_lines.rb
Instance Method Summary collapse
- #add_msg_obj(msg, obj, context = Array.new) ⇒ Object
-
#initialize(io, location = "") ⇒ ElementLines
constructor
A new instance of ElementLines.
- #write_line(str) ⇒ Object
Constructor Details
#initialize(io, location = "") ⇒ ElementLines
Returns a new instance of ElementLines.
7 8 9 10 11 |
# File 'lib/logue/elements/element_lines.rb', line 7 def initialize io, location = "" @io = io @factory = ElementFactory.new self @location = location end |
Instance Method Details
#add_msg_obj(msg, obj, context = Array.new) ⇒ Object
18 19 20 21 |
# File 'lib/logue/elements/element_lines.rb', line 18 def add_msg_obj msg, obj, context = Array.new element = @factory.to_element msg, obj, context element.write_element end |
#write_line(str) ⇒ Object
13 14 15 16 |
# File 'lib/logue/elements/element_lines.rb', line 13 def write_line str lstr = @location + " " + str @io.puts lstr end |