class ActiveFacts::Metamodel::DataType::Context

A DataType Context class should refine this class. The default context might work for you.

Public Class Methods

new(options = {}) click to toggle source
# File lib/activefacts/metamodel/datatypes.rb, line 66
def initialize options = {}
  raise "Unused options in DataType::Context: #{options.inspect}" unless options.empty?
end

Public Instance Methods

boolean_type() click to toggle source
# File lib/activefacts/metamodel/datatypes.rb, line 82
def boolean_type
end
choose_integer_range(min, max) click to toggle source
# File lib/activefacts/metamodel/datatypes.rb, line 76
def choose_integer_range min, max
  integer_ranges.
    select{|type_name, vmin, vmax| min >= vmin && max <= vmax}.
    sort_by{|type_name, vmin, vmax| vmax-vmin}[0]   # Choose the smallest range
end
default_length(data_type, type_name) click to toggle source
# File lib/activefacts/metamodel/datatypes.rb, line 73
def default_length data_type, type_name
end
integer_ranges() click to toggle source
# File lib/activefacts/metamodel/datatypes.rb, line 70
def integer_ranges
end
surrogate_type() click to toggle source
# File lib/activefacts/metamodel/datatypes.rb, line 85
def surrogate_type
end