Class: Treyja::Command::Json
- Inherits:
-
Object
- Object
- Treyja::Command::Json
- Defined in:
- lib/treyja/command/json.rb
Instance Attribute Summary collapse
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
Instance Method Summary collapse
-
#initialize(reader) ⇒ Json
constructor
A new instance of Json.
- #run ⇒ Object
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
#reader ⇒ Object (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
#run ⇒ Object
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 |