Class: Eco::API::UseCases::DefaultCases::CodesToTagsCase
- Inherits:
-
Common::Loaders::UseCase
- Object
- Common::Loaders::Base
- Common::Loaders::CaseBase
- Common::Loaders::UseCase
- Eco::API::UseCases::DefaultCases::CodesToTagsCase
- Defined in:
- lib/eco/api/usecases/default_cases/codes_to_tags_case.rb
Instance Attribute Summary
Attributes inherited from Common::Loaders::CaseBase
Attributes included from Language::AuxiliarLogger
Instance Method Summary collapse
Methods inherited from Common::Loaders::UseCase
Methods inherited from Common::Loaders::CaseBase
Methods inherited from Common::Loaders::Base
<=>, created_at, #initialize, #name, set_created_at!
Methods included from Common::ClassHelpers
#class_resolver, #descendants, #descendants?, #inheritable_attrs, #inheritable_class_vars, #inherited, #instance_variable_name, #new_class, #resolve_class, #to_constant
Methods included from Language::AuxiliarLogger
Constructor Details
This class inherits a constructor from Eco::API::Common::Loaders::UseCase
Instance Method Details
#codes_to_tags ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/eco/api/usecases/default_cases/codes_to_tags_case.rb', line 5 def raise "You have not defined a tagtree for the organisation" unless session.tagtree csv_table = Eco::CSV.read(input_file) csv_table.add_column("ecoPortalTag").tap do |csv_table| csv_table.each do |row| row["ecoPortalTag"] = to_tag(row[codes_column]) end File.open(output_file, "w") {|fd| fd << csv_table.to_csv} end end |
#main(session, options, usecase) ⇒ Object
18 19 20 21 |
# File 'lib/eco/api/usecases/default_cases/codes_to_tags_case.rb', line 18 def main(session, , usecase) [:end_get] = false end |