Class: FileGlob::GlobMatchData

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

Overview

Interface that quacks like Regexp’s MatchData. It should cover most common cases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stringObject (readonly)

Returns the value of attribute string.



33
34
35
# File 'lib/file_glob.rb', line 33

def string
  @string
end

Instance Method Details

#[](i) ⇒ Object



39
40
41
42
# File 'lib/file_glob.rb', line 39

def [] i
  check_index!(i)
  string
end

#begin(i) ⇒ Object



44
45
46
47
# File 'lib/file_glob.rb', line 44

def begin(i)
  check_index!(i)
  0
end

#endObject



49
50
51
52
# File 'lib/file_glob.rb', line 49

def end
  check_index!(i)
  string.length
end

#intialize(string) ⇒ Object



35
36
37
# File 'lib/file_glob.rb', line 35

def intialize(string)
  @string = string
end

#namesObject



60
61
62
# File 'lib/file_glob.rb', line 60

def names
  []
end

#sizeObject Also known as: length



54
55
56
# File 'lib/file_glob.rb', line 54

def size
  1
end