Class: Boundy::Range::Comparator

Inherits:
Object
  • Object
show all
Includes:
Comparator
Defined in:
lib/boundy/range/comparator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Comparator

included

Constructor Details

#initialize(domain, range) ⇒ Comparator

Returns a new instance of Comparator.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/boundy/range/comparator.rb', line 12

def initialize(domain, range)
  if domain.nil?
    raise
  end

  if range.nil?
    raise
  end

  other = Boundy::Domain.new(range.begin, range.end)
  @comparator = Boundy::Domain::Comparator.new(domain, other) 
end

Class Method Details

.typeObject



6
7
8
# File 'lib/boundy/range/comparator.rb', line 6

def self.type
  ::Range
end

Instance Method Details

#after?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/boundy/range/comparator.rb', line 25

def after?
  @comparator.after?
end

#before?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/boundy/range/comparator.rb', line 29

def before?
  @comparator.before?
end

#within?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/boundy/range/comparator.rb', line 33

def within?
  @comparator.within?
end