Class: Lines::Context
- Inherits:
-
Object
- Object
- Lines::Context
- Defined in:
- lib/lines.rb
Overview
Wrapper object that holds a given context. Emitted by Lines.with
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Context
constructor
A new instance of Context.
- #log(obj, args = {}) ⇒ Object
Constructor Details
#initialize(data) ⇒ Context
Returns a new instance of Context.
125 126 127 |
# File 'lib/lines.rb', line 125 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
123 124 125 |
# File 'lib/lines.rb', line 123 def data @data end |
Instance Method Details
#log(obj, args = {}) ⇒ Object
129 130 131 |
# File 'lib/lines.rb', line 129 def log(obj, args={}) Lines.log obj, Lines.ensure_hash!(args).merge(data) end |