Class: Thoth::Output::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/thoth/output/json.rb

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Json

Returns a new instance of Json.



5
6
7
# File 'lib/thoth/output/json.rb', line 5

def initialize(io)
  @io = io
end

Instance Method Details

#write(hash) ⇒ Object



9
10
11
# File 'lib/thoth/output/json.rb', line 9

def write(hash)
  @io.write("#{JSON.dump(hash)}\n")
end