Class: AprilONeil::XCTool
- Inherits:
-
Object
- Object
- AprilONeil::XCTool
- Defined in:
- lib/april_oneil/xctool.rb
Instance Method Summary collapse
-
#initialize(input, formatter) ⇒ XCTool
constructor
A new instance of XCTool.
- #start ⇒ Object
Constructor Details
#initialize(input, formatter) ⇒ XCTool
Returns a new instance of XCTool.
5 6 7 8 9 |
# File 'lib/april_oneil/xctool.rb', line 5 def initialize(input, formatter) @input = input @formatter = formatter @events = {} end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/april_oneil/xctool.rb', line 11 def start @formatter.before_start @input.each_line do |line| json = JSON.parse(line) event_name = json["event"] event_method = event_name.gsub("-", "_") @formatter.send(event_method, json) end @formatter.after_end end |