Class: SurrealDB::Range

Inherits:
Object
  • Object
show all
Defined in:
lib/surrealdb/models/range.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(begin_bound, end_bound) ⇒ Range

Returns a new instance of Range.

Parameters:



55
56
57
58
# File 'lib/surrealdb/models/range.rb', line 55

def initialize(begin_bound, end_bound)
  @begin_bound = begin_bound
  @end_bound = end_bound
end

Instance Attribute Details

#begin_boundBoundIncluded, ... (readonly)

Returns:



48
49
50
# File 'lib/surrealdb/models/range.rb', line 48

def begin_bound
  @begin_bound
end

#end_boundBoundIncluded, ... (readonly)

Returns:



51
52
53
# File 'lib/surrealdb/models/range.rb', line 51

def end_bound
  @end_bound
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



60
61
62
# File 'lib/surrealdb/models/range.rb', line 60

def ==(other)
  other.is_a?(Range) && other.begin_bound == @begin_bound && other.end_bound == @end_bound
end

#hashObject



65
66
67
# File 'lib/surrealdb/models/range.rb', line 65

def hash
  [self.class, @begin_bound, @end_bound].hash
end

#inspectObject



69
70
71
# File 'lib/surrealdb/models/range.rb', line 69

def inspect
  "SurrealDB::Range(#{@begin_bound.inspect}..#{@end_bound.inspect})"
end