Class: Whatsa::Section
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
Methods included from Format
#bulletize_lines, #heading_to_title, #remove_citation_markers, #url_friendly, #word_wrap
Constructor Details
#initialize(title, paragraphs) ⇒ Section
Returns a new instance of Section.
10 11 12 13 14 15 |
# File 'lib/whatsa/section.rb', line 10 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.
8 9 10 |
# File 'lib/whatsa/section.rb', line 8 def article @article end |
#paragraphs ⇒ Object
Returns the value of attribute paragraphs.
8 9 10 |
# File 'lib/whatsa/section.rb', line 8 def paragraphs @paragraphs end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/whatsa/section.rb', line 8 def title @title end |
Instance Method Details
#full_text ⇒ Object
21 22 23 |
# File 'lib/whatsa/section.rb', line 21 def full_text self.paragraphs.empty? ? "[no displayable information]" : self.paragraphs.join("\n\n") end |
#summary ⇒ Object
17 18 19 |
# File 'lib/whatsa/section.rb', line 17 def summary self.paragraphs.first || "[no displayable information]" end |