Class: Boundy::Range::Constrainer

Inherits:
Object
  • Object
show all
Defined in:
lib/boundy/range/constrainer.rb

Instance Method Summary collapse

Constructor Details

#initialize(domain, range) ⇒ Constrainer

Returns a new instance of Constrainer.



7
8
9
10
# File 'lib/boundy/range/constrainer.rb', line 7

def initialize(domain, range)
  other = Boundy::Domain.new(range.begin, range.end)
  @constrainer = Boundy::Domain::Constrainer.new(domain, other)
end

Instance Method Details

#constrainObject



12
13
14
# File 'lib/boundy/range/constrainer.rb', line 12

def constrain
  @constrainer.constrain
end