Class: Datanorm::Lines::V5::Text

Inherits:
Base
  • Object
show all
Defined in:
lib/datanorm/lines/v5/text.rb

Overview

One line of the Datanorm file starting with T

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

Constructor Details

This class inherits a constructor from Datanorm::Lines::Base

Instance Method Details

#<=>(other) ⇒ Object



24
25
26
# File 'lib/datanorm/lines/v5/text.rb', line 24

def <=>(other)
  line_number <=> other.line_number
end

#contentObject



20
21
22
# File 'lib/datanorm/lines/v5/text.rb', line 20

def content
  columns[5]
end

#idObject



12
13
14
# File 'lib/datanorm/lines/v5/text.rb', line 12

def id
  columns[2]
end

#line_numberObject



16
17
18
# File 'lib/datanorm/lines/v5/text.rb', line 16

def line_number
  columns[4].to_i
end

#to_sObject



8
9
10
# File 'lib/datanorm/lines/v5/text.rb', line 8

def to_s
  "[#{id}] TEXT-5 #{line_number} #{content}"
end