Class: Logue::BaseElement
- Inherits:
-
Object
- Object
- Logue::BaseElement
- Defined in:
- lib/logue/elements/base_element.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#writer ⇒ Object
readonly
Returns the value of attribute writer.
Instance Method Summary collapse
-
#initialize(context, writer) ⇒ BaseElement
constructor
A new instance of BaseElement.
- #write_line(str) ⇒ Object
- #write_msg_object(msg, object) ⇒ Object
Constructor Details
#initialize(context, writer) ⇒ BaseElement
Returns a new instance of BaseElement.
6 7 8 9 |
# File 'lib/logue/elements/base_element.rb', line 6 def initialize context, writer @context = context @writer = writer end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/logue/elements/base_element.rb', line 4 def context @context end |
#writer ⇒ Object (readonly)
Returns the value of attribute writer.
3 4 5 |
# File 'lib/logue/elements/base_element.rb', line 3 def writer @writer end |
Instance Method Details
#write_line(str) ⇒ Object
17 18 19 |
# File 'lib/logue/elements/base_element.rb', line 17 def write_line str @writer.write_line str end |
#write_msg_object(msg, object) ⇒ Object
11 12 13 14 15 |
# File 'lib/logue/elements/base_element.rb', line 11 def write_msg_object msg, object factory = ElementFactory.new @writer element = factory.to_element msg, object, @context element.write_element end |