Poem.rb
# this class needs to have the following items overwritten:
# method: get_poetry_type
# method: get_line_definitions
this class needs to have the following items overwritten:
method: get_poetry_type
method: get_line_definitions
this class needs to have the following items overwritten : method : get_poetry_type method : get_line_definitions
def read_poem_line_definitions( file_path )
      doc = Nokogiri::XML( File.open( file_path ) )
      @attribution_title = doc.xpath( "//lines/@title" )
      for l in 1..( PoemQueue::LINE_WORDS.count - 1 )
        if do_line_definitions_include_syllable?( l )
          instance_variable_set( "@#{PoemQueue::LINE_WORDS[l]}_syllable_lines", doc.xpath( "//line[@syllables='#{l}']/@text" ) )
        end
      end
    end
def read_poem_line_definitions ( file_path ) doc = Nokogiri :: XML ( File . open ( file_path ) ) @attribution_title = doc . xpath ( "//lines/@title" ) for l in 1 .. ( PoemQueue :: LINE_WORDS . count - 1 ) if do_line_definitions_include_syllable? ( l ) instance_variable_set ( "@#{PoemQueue::LINE_WORDS[l]}_syllable_lines" , doc . xpath ( "//line[@syllables='#{l}']/@text" ) ) end end end
this class needs to have the following items overwritten:
method: get_poetry_type
method: get_line_definitions
this class needs to have the following items overwritten : method : get_poetry_type method : get_line_definitions
# put the data into two arrays: # only if we need that line type (a line with that number of syllables) do we search for it with xpath.
file_path