Class: Dtn::Messages::Catalog::Code

Inherits:
Dtn::Message
  • Object
show all
Defined in:
lib/dtn/messages/catalog/code.rb

Overview

Code

Direct Known Subclasses

NaicCodes, SicCodes

Class Method Summary collapse

Methods inherited from Dtn::Message

callback_name, #callback_name

Class Method Details

.parse(line:) ⇒ Object

this Message does not respect commas



10
11
12
13
14
15
16
17
# File 'lib/dtn/messages/catalog/code.rb', line 10

def parse(line:, **)
  id, *description = line.split(",").reject(&:blank?)

  new.tap do |n|
    n.id = id.to_i
    n.description = description.join(",").gsub('"', "")
  end
end