Module: Boundy::Domain

Defined in:
lib/boundy/domain.rb,
lib/boundy/domain/finite.rb,
lib/boundy/domain/builder.rb,
lib/boundy/domain/anterior.rb,
lib/boundy/domain/posterior.rb,
lib/boundy/domain/comparator.rb,
lib/boundy/domain/constrainer.rb

Defined Under Namespace

Modules: Builder, InstanceMethods, Plugin Classes: Anterior, Comparator, Constrainer, Finite, Posterior

Class Method Summary collapse

Class Method Details

.builderObject



46
47
48
# File 'lib/boundy/domain.rb', line 46

def self.builder
  @builder ||= Builder.new
end

.new(b, e = nil) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/boundy/domain.rb', line 59

def self.new(b,e=nil)
  if b.class <= Boundy::Domain::Plugin 
    b
  else
    b = translate(b)
    e = translate(e)

    built = builder.build(b,e)
    unless built.class < Plugin
      raise
    end
    built
  end
end

.translate(bound) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/boundy/domain.rb', line 51

def self.translate(bound)
  if bound.class <= Boundy::Bound or bound.class < Boundy::Bound::Infinite
    bound
  else
    Boundy::Bound.new(bound)
  end
end