Class: Overlaps::PseudoRange

Inherits:
Object
  • Object
show all
Defined in:
lib/overlaps/pseudo_range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(range, accessors = {}) ⇒ PseudoRange

Returns a new instance of PseudoRange.



5
6
7
8
9
# File 'lib/overlaps/pseudo_range.rb', line 5

def initialize(range, accessors = {})
  verify_input(range, accessors)
  ensure_points_are_same_class
  build
end

Instance Attribute Details

#end_pointObject

Returns the value of attribute end_point.



3
4
5
# File 'lib/overlaps/pseudo_range.rb', line 3

def end_point
  @end_point
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/overlaps/pseudo_range.rb', line 3

def id
  @id
end

#start_pointObject

Returns the value of attribute start_point.



3
4
5
# File 'lib/overlaps/pseudo_range.rb', line 3

def start_point
  @start_point
end

Instance Method Details

#pointsObject



11
12
13
# File 'lib/overlaps/pseudo_range.rb', line 11

def points
  [@start_point, @end_point]
end

#rangeObject



15
16
17
# File 'lib/overlaps/pseudo_range.rb', line 15

def range
  (@start_point.value..@end_point.value)
end

#typeObject



19
20
21
# File 'lib/overlaps/pseudo_range.rb', line 19

def type
  @start_point.value.class
end