Class: Lines::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/lines.rb

Overview

Wrapper object that holds a given context. Emitted by Lines.context

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Context

Returns a new instance of Context.



142
143
144
# File 'lib/lines.rb', line 142

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



140
141
142
# File 'lib/lines.rb', line 140

def data
  @data
end

Instance Method Details

#log(obj, args = {}) ⇒ Object

Works like the Lines.log method.



147
148
149
# File 'lib/lines.rb', line 147

def log(obj, args={})
  Lines.log obj, Lines.ensure_hash!(args).merge(data)
end