Class: Whatsa::Section

Inherits:
Object
  • Object
show all
Includes:
Format
Defined in:
lib/whatsa/section.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#articleObject

Returns the value of attribute article.



8
9
10
# File 'lib/whatsa/section.rb', line 8

def article
  @article
end

#paragraphsObject

Returns the value of attribute paragraphs.



8
9
10
# File 'lib/whatsa/section.rb', line 8

def paragraphs
  @paragraphs
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/whatsa/section.rb', line 8

def title
  @title
end

Instance Method Details

#full_textObject



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

#summaryObject



17
18
19
# File 'lib/whatsa/section.rb', line 17

def summary
  self.paragraphs.first || "[no displayable information]"
end