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
Returns a new instance of Section.
4 5 6 7 8 |
# File 'lib/whatsa/section.rb', line 4 def initialize(title, paragraphs) @title = title @paragraphs = paragraphs remove_citations 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
14 15 16 |
# File 'lib/whatsa/section.rb', line 14 def full_text self.paragraphs.join("\n\n") end |
#summary ⇒ Object
10 11 12 |
# File 'lib/whatsa/section.rb', line 10 def summary self.paragraphs.first end |