Class: Mulder::Formats::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/mulder/formats/json.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#instances

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Mulder::Formats::Base

Instance Attribute Details

#streamObject



8
9
10
# File 'lib/mulder/formats/json.rb', line 8

def stream
  @stream || STDOUT
end

Instance Method Details

#outputObject



12
13
14
# File 'lib/mulder/formats/json.rb', line 12

def output
  stream.write(instances.collect(&:as_hash).to_json)
end