Class: EppoClient::ShardRange

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

Overview

A class for checking if a shard is in a range

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(range_start, range_end) ⇒ ShardRange

Returns a new instance of ShardRange.



11
12
13
14
# File 'lib/shard.rb', line 11

def initialize(range_start, range_end)
  @start = range_start
  @end = range_end
end

Instance Attribute Details

#endObject (readonly)

Returns the value of attribute end.



9
10
11
# File 'lib/shard.rb', line 9

def end
  @end
end

#startObject (readonly)

Returns the value of attribute start.



9
10
11
# File 'lib/shard.rb', line 9

def start
  @start
end

Instance Method Details

#shard_in_range?(shard) ⇒ Boolean

Returns:

  • (Boolean)


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

def shard_in_range?(shard)
  shard >= @start && shard < @end
end