Class: Avmtrf1::Forponto::Parsers::Espelho::SummaryNode

Inherits:
SubNode
  • Object
show all
Includes:
MethodsAsFields, EacRubyUtils::SimpleCache
Defined in:
lib/avmtrf1/forponto/parsers/espelho/summary_node.rb

Constant Summary collapse

FIELDS =
%w[code description time minutes].freeze

Instance Attribute Summary

Attributes inherited from SubNode

#node

Instance Method Summary collapse

Methods included from MethodsAsFields

#data, #methods_as_fields

Methods inherited from SubNode

#initialize

Constructor Details

This class inherits a constructor from Avmtrf1::Forponto::Parsers::Espelho::SubNode

Instance Method Details

#codeObject


16
17
18
# File 'lib/avmtrf1/forponto/parsers/espelho/summary_node.rb', line 16

def code
  code_description_parsed.code
end

#descriptionObject


20
21
22
# File 'lib/avmtrf1/forponto/parsers/espelho/summary_node.rb', line 20

def description
  code_description_parsed.description
end

#minutesObject


28
29
30
31
32
33
34
35
# File 'lib/avmtrf1/forponto/parsers/espelho/summary_node.rb', line 28

def minutes
  return nil unless time.present?

  m = /\A(\d+):(\d+)\z/.match(time)
  raise "\"#{time}\" does not match time pattern" unless m

  m[1].to_i * 60 + m[2].to_i
end

#timeObject


24
25
26
# File 'lib/avmtrf1/forponto/parsers/espelho/summary_node.rb', line 24

def time
  column_text('20%')
end