Class: Reading::Parsing::Attributes::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/reading/parsing/attributes/attribute.rb

Overview

The base class for all the attribute in parsing/attributes, each of which extracts an attribute from a parsed row. Together they transform the parsed row (an intermediate hash) into item attributes, as in Config#default_config[:template].

Direct Known Subclasses

Author, Experiences, Genres, Notes, Rating, Title, Variants

Instance Method Summary collapse

Instance Method Details

#transform_from_parsed(parsed_row, head_index) ⇒ Object

Extracts this attribute’s value from a parsed row.

Parameters:

  • parsed_row (Hash)

    a parsed row (the intermediate hash).

  • head_index (Integer)

    current item’s position in the Head column.

Returns:

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/reading/parsing/attributes/attribute.rb', line 13

def transform_from_parsed(parsed_row, head_index)
  raise NotImplementedError, "#{self.class} should have implemented #{__method__}"
end