Class: Whatsa::Section
- Inherits:
-
Object
- Object
- Whatsa::Section
- Defined in:
- lib/whatsa/section.rb
Instance Attribute Summary collapse
-
#article ⇒ Object
Returns the value of attribute article.
-
#paragraphs ⇒ Object
Returns the value of attribute paragraphs.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #full_text ⇒ Object
-
#initialize(title, paragraphs) ⇒ Section
constructor
A new instance of Section.
- #summary ⇒ Object
Constructor Details
#initialize(title, paragraphs) ⇒ Section
4 5 6 7 8 9 |
# File 'lib/whatsa/section.rb', line 4 def initialize(title, paragraphs) @title = title @paragraphs = paragraphs remove_citations bullet_list_pars end |
Instance Attribute Details
#article ⇒ Object
Returns the value of attribute article.
2 3 4 |
# File 'lib/whatsa/section.rb', line 2 def article @article end |
#paragraphs ⇒ Object
Returns the value of attribute paragraphs.
2 3 4 |
# File 'lib/whatsa/section.rb', line 2 def paragraphs @paragraphs end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/whatsa/section.rb', line 2 def title @title end |
Instance Method Details
#full_text ⇒ Object
15 16 17 |
# File 'lib/whatsa/section.rb', line 15 def full_text self.paragraphs.empty? ? "[no displayable information]" : self.paragraphs.join("\n\n") end |
#summary ⇒ Object
11 12 13 |
# File 'lib/whatsa/section.rb', line 11 def summary self.paragraphs.first || "[no displayable information]" end |