Class: FDB::KeySelector

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, or_equal, offset) ⇒ KeySelector

Returns a new instance of KeySelector.



672
673
674
675
676
# File 'lib/fdbimpl.rb', line 672

def initialize(key, or_equal, offset)
  @key = key
  @or_equal = or_equal
  @offset = offset
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



670
671
672
# File 'lib/fdbimpl.rb', line 670

def key
  @key
end

#offsetObject (readonly)

Returns the value of attribute offset.



670
671
672
# File 'lib/fdbimpl.rb', line 670

def offset
  @offset
end

#or_equalObject (readonly)

Returns the value of attribute or_equal.



670
671
672
# File 'lib/fdbimpl.rb', line 670

def or_equal
  @or_equal
end

Class Method Details

.first_greater_or_equal(key) ⇒ Object



690
691
692
# File 'lib/fdbimpl.rb', line 690

def self.first_greater_or_equal(key)
  self.new(key, 0, 1)
end

.first_greater_than(key) ⇒ Object



686
687
688
# File 'lib/fdbimpl.rb', line 686

def self.first_greater_than(key)
  self.new(key, 1, 1)
end

.last_less_or_equal(key) ⇒ Object



682
683
684
# File 'lib/fdbimpl.rb', line 682

def self.last_less_or_equal(key)
  self.new(key, 1, 0)
end

.last_less_than(key) ⇒ Object



678
679
680
# File 'lib/fdbimpl.rb', line 678

def self.last_less_than(key)
  self.new(key, 0, 0)
end

Instance Method Details

#+(offset) ⇒ Object



694
695
696
# File 'lib/fdbimpl.rb', line 694

def +(offset)
  KeySelector.new(@key, @or_equal, @offset + offset)
end

#-(offset) ⇒ Object



698
699
700
# File 'lib/fdbimpl.rb', line 698

def -(offset)
  KeySelector.new(@key, @or_equal, @offset - offset)
end