Class: EppoClient::ShardRange
- Inherits:
-
Object
- Object
- EppoClient::ShardRange
- Defined in:
- lib/shard.rb
Overview
A class for checking if a shard is in a range
Instance Attribute Summary collapse
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(range_start, range_end) ⇒ ShardRange
constructor
A new instance of ShardRange.
- #shard_in_range?(shard) ⇒ Boolean
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
#end ⇒ Object (readonly)
Returns the value of attribute end.
9 10 11 |
# File 'lib/shard.rb', line 9 def end @end end |
#start ⇒ Object (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
16 17 18 |
# File 'lib/shard.rb', line 16 def shard_in_range?(shard) shard >= @start && shard < @end end |