Class: Reading::Parsing::Attributes::Notes
- Defined in:
- lib/reading/parsing/attributes/notes.rb
Overview
Transformer for the :notes item attribute.
Instance Method Summary collapse
-
#transform_from_parsed(parsed_row, _head_index) ⇒ Array<Hash>
An array of notes; see Config#default_config[:template].
Instance Method Details
#transform_from_parsed(parsed_row, _head_index) ⇒ Array<Hash>
Returns an array of notes; see Config#default_config[:template].
10 11 12 13 14 15 16 17 18 |
# File 'lib/reading/parsing/attributes/notes.rb', line 10 def transform_from_parsed(parsed_row, _head_index) parsed_row[:notes]&.map { |note| { blurb?: note.has_key?(:note_blurb), private?: note.has_key?(:note_private), content: note[:note_regular] || note[:note_blurb] || note[:note_private], } } end |