Class: Paragraph
- Inherits:
-
Object
- Object
- Paragraph
- Defined in:
- lib/formatters/paragraph.rb
Instance Method Summary collapse
- #add_link(description, link) ⇒ Object
- #add_sentence(sentence) ⇒ Object
- #get_paragraph ⇒ Object
-
#initialize ⇒ Paragraph
constructor
A new instance of Paragraph.
Constructor Details
#initialize ⇒ Paragraph
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
#add_link(description, link) ⇒ Object
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_paragraph ⇒ Object
17 18 19 |
# File 'lib/formatters/paragraph.rb', line 17 def get_paragraph @paragraph end |