Class: Boundy::Domain::Constrainer
- Inherits:
-
Object
- Object
- Boundy::Domain::Constrainer
- Defined in:
- lib/boundy/domain/constrainer.rb
Instance Method Summary collapse
- #constrain ⇒ Object
-
#initialize(me, other) ⇒ Constrainer
constructor
A new instance of Constrainer.
Constructor Details
#initialize(me, other) ⇒ Constrainer
Returns a new instance of Constrainer.
7 8 9 10 |
# File 'lib/boundy/domain/constrainer.rb', line 7 def initialize(me, other) @me = me @other = other end |
Instance Method Details
#constrain ⇒ Object
13 14 15 16 17 18 |
# File 'lib/boundy/domain/constrainer.rb', line 13 def constrain from = Boundy::Bound::Constrainer.new(@me.from, @other.from) to = Boundy::Bound::Constrainer.new(@me.to, @other.to) Boundy::Domain.new(from.max, to.min) end |