Class: ODDB::OdbaExporter::Line
Instance Method Summary
collapse
Constructor Details
#initialize(*args) ⇒ Line
Returns a new instance of Line.
267
268
269
270
|
# File 'ext/export/src/oddbdat.rb', line 267
def initialize(*args)
@date = Date.today.strftime("%Y%m%d%H%M%S")
@structure = structure
end
|
Instance Method Details
#content(structure) ⇒ Object
271
272
273
274
275
276
277
278
279
|
# File 'ext/export/src/oddbdat.rb', line 271
def content(structure)
return [] if structure.nil?
fields = Array.new(self::class::LENGTH)
structure.each_pair { |place, field|
fields[place-1] = field
}
fields
end
|
#empty? ⇒ Boolean
280
281
282
|
# File 'ext/export/src/oddbdat.rb', line 280
def empty?
@structure.nil?
end
|
#structure ⇒ Object
283
284
|
# File 'ext/export/src/oddbdat.rb', line 283
def structure
end
|
285
286
287
|
# File 'ext/export/src/oddbdat.rb', line 285
def to_s
content(@structure).join('|').gsub("\000", "")
end
|