Method: Parser.title_and_body_by_keyword_from_string

Defined in:
lib/parser.rb

.title_and_body_by_keyword_from_string(hash) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/parser.rb', line 11

def self.title_and_body_by_keyword_from_string(hash)
  parser = self.new(hash)
  titles = parser.parse_titles
  bodies = parser.parse_bodies
  arr = []
  titles.each_with_index do |t,i|
    arr << {:title => t, :body => bodies[i]}
  end
  arr
end