Class: GitShizzle::IndexSpecifications::File

Inherits:
Base
  • Object
show all
Defined in:
lib/git_shizzle/index_specifications/file.rb

Instance Method Summary collapse

Methods inherited from Base

#matches, #register_match

Constructor Details

#initialize(index) ⇒ File

Returns a new instance of File.



5
6
7
8
# File 'lib/git_shizzle/index_specifications/file.rb', line 5

def initialize(index)
  assert_numeric index
  @index = index.to_i
end

Instance Method Details

#include?(index) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/git_shizzle/index_specifications/file.rb', line 10

def include?(index)
  @index == index
end

#inspectObject



18
19
20
# File 'lib/git_shizzle/index_specifications/file.rb', line 18

def inspect
  "#{self.class}: #{@index}"
end

#unmatchedObject



14
15
16
# File 'lib/git_shizzle/index_specifications/file.rb', line 14

def unmatched
  ([] << @index) - matches
end