Class: Eco::API::Common::People::DefaultParsers::XLSParser

Inherits:
Loaders::Parser show all
Defined in:
lib/eco/api/common/people/default_parsers/xls_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Loaders::Parser

active_when_all, active_when_any, attribute, #attribute, dependencies, #initialize, parsing_phase, serializing_phase

Methods inherited from Loaders::CaseBase

#name, name_only_once!, original_name

Constructor Details

This class inherits a constructor from Eco::API::Common::Loaders::Parser

Instance Attribute Details

#already_requiredObject

Returns the value of attribute already_required.



4
5
6
# File 'lib/eco/api/common/people/default_parsers/xls_parser.rb', line 4

def already_required
  @already_required
end

Instance Method Details

#parser(filename, _deps) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/eco/api/common/people/default_parsers/xls_parser.rb', line 6

def parser(filename, _deps)
  rows(file: filename).tap do |rws|
    rws.each do |row|
      to_string!(row)
    end
  end
end

#serializer(_array_hash, _deps) ⇒ Object



14
15
16
# File 'lib/eco/api/common/people/default_parsers/xls_parser.rb', line 14

def serializer(_array_hash, _deps)
  raise 'Not implemented. TODO: using axlsx or rubyXL gems. See: https://spin.atomicobject.com/2017/03/22/parsing-excel-files-ruby/'
end