Class: GitShizzle::IndexSpecifications::ExclusiveRange
- Inherits:
-
Base
- Object
- Base
- GitShizzle::IndexSpecifications::ExclusiveRange
show all
- Defined in:
- lib/git_shizzle/index_specifications/exclusive_range.rb
Instance Method Summary
collapse
Methods inherited from Base
#matches, #register_match
Constructor Details
Returns a new instance of ExclusiveRange.
5
6
7
8
9
10
|
# File 'lib/git_shizzle/index_specifications/exclusive_range.rb', line 5
def initialize(index)
spec = index.split('...')
assert_numeric index, *spec
@range = ::Range.new(*spec.map(&:to_i)).to_a[0..-2]
end
|
Instance Method Details
#include?(index) ⇒ Boolean
12
13
14
|
# File 'lib/git_shizzle/index_specifications/exclusive_range.rb', line 12
def include?(index)
@range.include? index
end
|
#inspect ⇒ Object
20
21
22
|
# File 'lib/git_shizzle/index_specifications/exclusive_range.rb', line 20
def inspect
"#{self.class}: #{@range.inspect}"
end
|
#unmatched ⇒ Object
16
17
18
|
# File 'lib/git_shizzle/index_specifications/exclusive_range.rb', line 16
def unmatched
@range - matches
end
|