Class: WikiOnThisDay::Printer

Inherits:
Object
  • Object
show all
Defined in:
lib/wiki_on_this_day/printer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(snippet) ⇒ Printer

Returns a new instance of Printer.



5
6
7
# File 'lib/wiki_on_this_day/printer.rb', line 5

def initialize(snippet)
  @snippet = snippet
end

Instance Attribute Details

#snippetObject (readonly)

Returns the value of attribute snippet.



3
4
5
# File 'lib/wiki_on_this_day/printer.rb', line 3

def snippet
  @snippet
end

Instance Method Details



9
10
11
12
# File 'lib/wiki_on_this_day/printer.rb', line 9

def print
  puts snippet.year
  puts snippet.text
end