class Whatsa::Section

Attributes

article[RW]
paragraphs[RW]
title[RW]

Public Class Methods

new(title, paragraphs) click to toggle source
# File lib/whatsa/section.rb, line 10
def initialize(title, paragraphs)
  @title = title
  @paragraphs = paragraphs
  remove_citations
  bullet_list_pars
end

Public Instance Methods

full_text() click to toggle source
# File lib/whatsa/section.rb, line 21
def full_text
  self.paragraphs.empty? ? "[no displayable information]" : self.paragraphs.join("\n\n")
end
summary() click to toggle source
# File lib/whatsa/section.rb, line 17
def summary
  self.paragraphs.first || "[no displayable information]"
end

Private Instance Methods

bullet_list_pars() click to toggle source
# File lib/whatsa/section.rb, line 31
def bullet_list_pars
  self.paragraphs.map! { |par| bulletize_lines(par) }
end
remove_citations() click to toggle source
# File lib/whatsa/section.rb, line 27
def remove_citations
  self.paragraphs.map! { |par| remove_citation_markers(par) }
end