Class: Thoth::Output::Json
- Inherits:
-
Object
- Object
- Thoth::Output::Json
- Defined in:
- lib/thoth/output/json.rb
Instance Method Summary collapse
-
#initialize(io) ⇒ Json
constructor
A new instance of Json.
- #write(hash) ⇒ Object
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 |