Class: Itamae::Handler::Json

Inherits:
Base
  • Object
show all
Defined in:
lib/itamae/handler/json.rb

Instance Attribute Summary

Attributes inherited from Base

#actions, #recipes, #resources

Instance Method Summary collapse

Constructor Details

#initializeJson

Returns a new instance of Json.



4
5
6
7
8
# File 'lib/itamae/handler/json.rb', line 4

def initialize(*)
  super
  require 'time'
  open_file
end

Instance Method Details

#event(type, payload = {}) ⇒ Object



10
11
12
13
# File 'lib/itamae/handler/json.rb', line 10

def event(type, payload = {})
  super
  @f.puts({'time' => Time.now.iso8601, 'event' => type, 'payload' => payload}.to_json)
end