Class: Logn::Shell

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#eventsObject (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

#showObject



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

#startObject



18
19
20
# File 'lib/logn.rb', line 18

def start
  binding.pry(quiet: true)
end