Class: Boundy::Range::Constrainer
- Inherits:
-
Object
- Object
- Boundy::Range::Constrainer
- Defined in:
- lib/boundy/range/constrainer.rb
Instance Method Summary collapse
- #constrain ⇒ Object
-
#initialize(domain, range) ⇒ Constrainer
constructor
A new instance of Constrainer.
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
#constrain ⇒ Object
12 13 14 |
# File 'lib/boundy/range/constrainer.rb', line 12 def constrain @constrainer.constrain end |