Class: ODDB::OdbaExporter::Line

Inherits:
Object
  • Object
show all
Defined in:
ext/export/src/oddbdat.rb

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|
		# schlüssel in structure entsprechen der OddbDat-Doku
		fields[place-1] = field 
	}
	fields
end

#empty?Boolean

Returns:

  • (Boolean)


280
281
282
# File 'ext/export/src/oddbdat.rb', line 280

def empty?
	@structure.nil?
end

#structureObject



283
284
# File 'ext/export/src/oddbdat.rb', line 283

def structure
end

#to_sObject



285
286
287
# File 'ext/export/src/oddbdat.rb', line 285

def to_s
	content(@structure).join('|').gsub("\000", "")
end