Class: Rrant::Output

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

Overview

Public: Outputs rant hash, or serialized rant with image to the STDOUT.

rant - Hash, rant to be outputed. show_images - Boolean, when set we output attached image also.

Instance Method Summary collapse

Constructor Details

#initialize(rant, show_images) ⇒ Output

Returns a new instance of Output.



9
10
11
12
# File 'lib/rrant/output.rb', line 9

def initialize(rant, show_images)
  @rant = rant
  @show_images = show_images
end

Instance Method Details

#inObject

Public: Returns rant as a hash.



15
16
17
# File 'lib/rrant/output.rb', line 15

def in
  @rant
end

#outObject

Public: Prints serialzied rant to the STDOUT.



20
21
22
23
24
# File 'lib/rrant/output.rb', line 20

def out
  puts_image
  puts @rant['text']
  puts footer
end