Class: Reading::Row::GenresAttribute

Inherits:
Attribute show all
Defined in:
lib/reading/attribute/all_attributes.rb

Instance Method Summary collapse

Methods inherited from Attribute

#initialize

Constructor Details

This class inherits a constructor from Reading::Row::Attribute

Instance Method Details

#parseObject



52
53
54
55
56
57
58
59
60
61
# File 'lib/reading/attribute/all_attributes.rb', line 52

def parse
  return nil unless columns[:genres]

  columns[:genres]
    .split(config.deep_fetch(:csv, :separator))
    .map(&:strip)
    .map(&:downcase)
    .map(&:presence)
    .compact.presence
end