Class: Dtn::Messages::Catalog::Code
- Inherits:
-
Dtn::Message
- Object
- OpenStruct
- Dtn::Message
- Dtn::Messages::Catalog::Code
- Defined in:
- lib/dtn/messages/catalog/code.rb
Overview
Code
Class Method Summary collapse
-
.parse(line:) ⇒ Object
this Message does not respect commas.
Methods inherited from Dtn::Message
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 |