Class: Logue::BlockElement
- Inherits:
-
BaseElement
- Object
- BaseElement
- Logue::BlockElement
- Defined in:
- lib/logue/elements/block_element.rb
Instance Attribute Summary
Attributes inherited from BaseElement
Instance Method Summary collapse
-
#initialize(msg, context, writer, &blk) ⇒ BlockElement
constructor
A new instance of BlockElement.
- #write_element ⇒ Object
Methods inherited from BaseElement
#write_line, #write_msg_object
Constructor Details
#initialize(msg, context, writer, &blk) ⇒ BlockElement
5 6 7 8 9 |
# File 'lib/logue/elements/block_element.rb', line 5 def initialize msg, context, writer, &blk super context, writer @msg = msg @blk = blk end |
Instance Method Details
#write_element ⇒ Object
11 12 13 14 |
# File 'lib/logue/elements/block_element.rb', line 11 def write_element obj = @blk.call write_msg_object @msg, obj end |