Class: Baldrick::Listeners::InjourListener
- Inherits:
-
Object
- Object
- Baldrick::Listeners::InjourListener
- Defined in:
- lib/baldrick/listeners/injour_listener.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ InjourListener
constructor
A new instance of InjourListener.
- #orders ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ InjourListener
Returns a new instance of InjourListener.
4 5 6 |
# File 'lib/baldrick/listeners/injour_listener.rb', line 4 def initialize = {} @last_orders = {} end |
Instance Method Details
#orders ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/baldrick/listeners/injour_listener.rb', line 8 def orders order_pattern = /=== (.*?) on (.*?) ===\n\* \[(.*?)\] (.*?)\n/m all_orders = `injour ls`.scan(order_pattern).collect do |match| { :who => match[0], :where => match[1], :when => Time.parse(match[2]), :what => match[3] } end select_new_orders_from all_orders end |