Class: Paragraph

Inherits:
Object
  • Object
show all
Defined in:
lib/formatters/paragraph.rb

Instance Method Summary collapse

Constructor Details

#initializeParagraph

Returns a new instance of Paragraph.



4
5
6
7
# File 'lib/formatters/paragraph.rb', line 4

def initialize
  # An array of sentences (strings) and links
  @paragraph = []
end

Instance Method Details



9
10
11
# File 'lib/formatters/paragraph.rb', line 9

def add_link description, link
  @paragraph << {:link => [description, link]}
end

#add_sentence(sentence) ⇒ Object



13
14
15
# File 'lib/formatters/paragraph.rb', line 13

def add_sentence sentence
  @paragraph << {:sentence => sentence}
end

#get_paragraphObject



17
18
19
# File 'lib/formatters/paragraph.rb', line 17

def get_paragraph
  @paragraph
end