Class: Reading::Parsing::Attributes::Title
- Defined in:
- lib/reading/parsing/attributes/title.rb
Overview
Transformer for the :title item attribute.
Instance Method Summary collapse
Instance Method Details
#transform_from_parsed(parsed_row, head_index) ⇒ String
9 10 11 12 13 14 15 16 17 |
# File 'lib/reading/parsing/attributes/title.rb', line 9 def transform_from_parsed(parsed_row, head_index) title = parsed_row[:head][head_index][:title] if title.nil? || title.end_with?(" -") raise InvalidHeadError, "Missing title in the head #{parsed_row[:head][head_index]}" end title end |