Class: Itamae::Handler::Json
Instance Attribute Summary
Attributes inherited from Base
#actions, #recipes, #resources
Instance Method Summary collapse
- #event(type, payload = {}) ⇒ Object
-
#initialize ⇒ Json
constructor
A new instance of Json.
Constructor Details
#initialize ⇒ Json
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 |