Class: Reading::Parsing::Attributes::Experiences

Inherits:
Attribute show all
Defined in:
lib/reading/parsing/attributes/experiences.rb,
lib/reading/parsing/attributes/experiences/spans_validator.rb,
lib/reading/parsing/attributes/experiences/history_transformer.rb,
lib/reading/parsing/attributes/experiences/dates_and_head_transformer.rb

Overview

Transformer for the :experiences item attribute.

Defined Under Namespace

Modules: SpansValidator Classes: DatesAndHeadTransformer, HistoryTransformer

Instance Method Summary collapse

Instance Method Details

#transform_from_parsed(parsed_row, head_index) ⇒ Array<Hash>

Returns an array of experiences; see Config#default_config[:template].

Parameters:

  • parsed_row (Hash)

    a parsed row (the intermediate hash).

  • head_index (Integer)

    current item’s position in the Head column.

Returns:



17
18
19
20
21
22
23
# File 'lib/reading/parsing/attributes/experiences.rb', line 17

def transform_from_parsed(parsed_row, head_index)
  if !parsed_row[:history].blank?
    return HistoryTransformer.new(parsed_row, head_index).transform
  end

  DatesAndHeadTransformer.new(parsed_row, head_index).transform
end