Class: Datanorm::Lines::V4::Text
- Inherits:
-
Base
- Object
- Base
- Datanorm::Lines::V4::Text
show all
- Defined in:
- lib/datanorm/lines/v4/text.rb
Overview
Wraps a line of a DATANORM file that represents one line of a product description. Also known as Langtextsatz.
Instance Attribute Summary
Attributes inherited from Base
#columns, #source_line_number
Instance Method Summary
collapse
Methods inherited from Base
#as_json, #encode, inherited, #initialize, #record_kind, #to_json
Instance Method Details
#<=>(other) ⇒ Object
25
26
27
|
# File 'lib/datanorm/lines/v4/text.rb', line 25
def <=>(other)
line_number <=> other.line_number
end
|
#content ⇒ Object
21
22
23
|
# File 'lib/datanorm/lines/v4/text.rb', line 21
def content
[columns[6], columns[9]].join("\n").strip
end
|
#id ⇒ Object
13
14
15
|
# File 'lib/datanorm/lines/v4/text.rb', line 13
def id
columns[2]
end
|
#line_number ⇒ Object
17
18
19
|
# File 'lib/datanorm/lines/v4/text.rb', line 17
def line_number
columns[4].to_i
end
|
#to_s ⇒ Object
9
10
11
|
# File 'lib/datanorm/lines/v4/text.rb', line 9
def to_s
"TEXT [#{id}] <#{line_number}> #{content.encode('UTF-8', 'CP850').gsub("\n", '⏎')}"
end
|