Class: Reading::Row::SeriesSubattribute

Inherits:
Object
  • Object
show all
Defined in:
lib/reading/attribute/variants/series_subattribute.rb

Instance Method Summary collapse

Constructor Details

#initialize(item_head:, variant_with_extras: nil, config:) ⇒ SeriesSubattribute

Returns a new instance of SeriesSubattribute.

Parameters:

  • item_head (String)

    see Row#item_heads for a definition.

  • variant_with_extras (String) (defaults to: nil)

    the full variant string.

  • config (Hash)


11
12
13
14
15
# File 'lib/reading/attribute/variants/series_subattribute.rb', line 11

def initialize(item_head:, variant_with_extras: nil, config:)
  @item_head = item_head
  @variant_with_extras = variant_with_extras
  @config = config
end

Instance Method Details

#parseObject



17
18
19
20
21
22
# File 'lib/reading/attribute/variants/series_subattribute.rb', line 17

def parse
  (
    Array(series(item_head)) +
      Array(series(variant_with_extras))
  ).presence
end

#parse_headObject



24
25
26
# File 'lib/reading/attribute/variants/series_subattribute.rb', line 24

def parse_head
  series(item_head)
end