module Record

(record) builder mini language / domain-specific language (dsl)

Constants

VERSION

Public Class Methods

banner() click to toggle source
define( super_class=Base, &block ) click to toggle source

alternative class (record) builder

# File lib/record/base.rb, line 151
def self.define( super_class=Base, &block )   ## check: rename super_class to base - why? why not?
  builder = Builder.new( super_class )
  if block.arity == 1
    block.call( builder )
    ## e.g. allows "yield" dsl style e.g.
    ##  Record.define do |rec|
    ##     rec.string :team1
    ##     rec.string :team2
    ##  end
    ##
  else
    builder.instance_eval( &block )
    ## e.g. shorter "instance eval" dsl style e.g.
    ##  Record.define do
    ##     string :team1
    ##     string :team2
    ##  end
  end
  builder.to_record
end
root() click to toggle source
# File lib/record/version.rb, line 24
def self.root
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end
version() click to toggle source
# File lib/record/version.rb, line 16
def self.version
  VERSION
end