Class: Reading::Row::ProgressSubattribute

Inherits:
Object
  • Object
show all
Defined in:
lib/reading/attribute/experiences/progress_subattribute.rb

Instance Method Summary collapse

Constructor Details

#initialize(date_entry: nil, variant_index: nil, columns:, config:) ⇒ ProgressSubattribute

Returns a new instance of ProgressSubattribute.

Parameters:

  • date_entry (String) (defaults to: nil)

    the entry in Dates Started.

  • variant_index (Integer) (defaults to: nil)

    the variant index, for getting length for default amount.

  • columns (Array<String>)
  • config (Hash)


12
13
14
15
16
17
# File 'lib/reading/attribute/experiences/progress_subattribute.rb', line 12

def initialize(date_entry: nil, variant_index: nil, columns:, config:)
  @date_entry = date_entry
  @variant_index = variant_index
  @columns = columns
  @config = config
end

Instance Method Details

#parseObject



19
20
21
# File 'lib/reading/attribute/experiences/progress_subattribute.rb', line 19

def parse
  progress(date_entry) || progress(columns[:head])
end

#parse_headObject



23
24
25
# File 'lib/reading/attribute/experiences/progress_subattribute.rb', line 23

def parse_head
  progress(columns[:head])
end