Module: Record

Included in:
Flat::File
Defined in:
lib/flat/record.rb

Overview

Record

A record abstracts on line or ‘record’ of a fixed width field. The methods available are the keys of the hash passed to the constructor. For example the call:

h = Hash['first_name','Andy','status','Supercool!']
r = Record::Definition.new(h)

would respond to r.first_name, and r.status yielding ‘Andy’ and ‘Supercool!’ respectively.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Definition

Class Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object

> module InstanceMethods



56
57
58
59
# File 'lib/flat/record.rb', line 56

def self.included receiver #:nodoc:
  receiver.extend         ClassMethods
  receiver.send :include, InstanceMethods
end