Class: Logn::Shell
- Inherits:
-
Object
- Object
- Logn::Shell
- Defined in:
- lib/logn.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
- #filter(&block) ⇒ Object
-
#initialize(events) ⇒ Shell
constructor
A new instance of Shell.
- #show ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(events) ⇒ Shell
Returns a new instance of Shell.
14 15 16 |
# File 'lib/logn.rb', line 14 def initialize(events) @events = events end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
12 13 14 |
# File 'lib/logn.rb', line 12 def events @events end |
Instance Method Details
#filter(&block) ⇒ Object
22 23 24 |
# File 'lib/logn.rb', line 22 def filter(&block) @events.add_filter &block end |
#show ⇒ Object
26 27 28 29 30 |
# File 'lib/logn.rb', line 26 def show formatter = EventFormatter.new(STDOUT) @events.each {|e| formatter.print e } nil end |
#start ⇒ Object
18 19 20 |
# File 'lib/logn.rb', line 18 def start binding.pry(quiet: true) end |