Class: Overlaps::Point

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/overlaps/point.rb

Direct Known Subclasses

EndPoint, StartPoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, id) ⇒ Point

Returns a new instance of Point.



7
8
9
10
# File 'lib/overlaps/point.rb', line 7

def initialize(value, id)
  @value = value
  @id = id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/overlaps/point.rb', line 5

def id
  @id
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/overlaps/point.rb', line 5

def value
  @value
end

Instance Method Details

#<=>(other_point) ⇒ Object



20
21
22
# File 'lib/overlaps/point.rb', line 20

def <=>(other_point)
  value <=> other_point.value
end

#end?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/overlaps/point.rb', line 16

def end?
  false
end

#start?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/overlaps/point.rb', line 12

def start?
  false
end