Module: FixedFields::ClassMethods

Defined in:
lib/fixed_fields.rb

Instance Method Summary collapse

Instance Method Details

#read_fields(record) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/fixed_fields.rb', line 22

def read_fields(record)
  instance = self.new
  self.field_info.each do |key, options|
    instance[key] = record[options[:begin], options[:width]]
  end
  
  instance
end