Class: Treyja::Command::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/treyja/command/json.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reader) ⇒ Json

Returns a new instance of Json.



6
7
8
# File 'lib/treyja/command/json.rb', line 6

def initialize reader
  @reader = reader
end

Instance Attribute Details

#readerObject (readonly)

Returns the value of attribute reader.



4
5
6
# File 'lib/treyja/command/json.rb', line 4

def reader
  @reader
end

Instance Method Details

#runObject



10
11
12
13
14
15
# File 'lib/treyja/command/json.rb', line 10

def run
  reader.each do |ts|
    puts ts.to_json
    STDOUT.flush
  end
end