Class: FileLines
Overview
load is not currently thread safe.
Instance Method Summary
collapse
Methods inherited from Array
#columns, #match?, #pc, #pr, #rows
Constructor Details
Returns a new instance of FileLines.
4
5
6
7
8
|
# File 'lib/innate/filelines.rb', line 4
def initialize(fn)
@fn = fn
@init = false
@loaded_all = false
end
|
Instance Method Details
17
18
19
20
|
# File 'lib/innate/filelines.rb', line 17
def [](r)
load r
super
end
|
#[]=(i, v) ⇒ Object
22
23
24
|
# File 'lib/innate/filelines.rb', line 22
def []=(i, v)
super
end
|
12
13
14
15
|
# File 'lib/innate/filelines.rb', line 12
def at(i)
load i
super
end
|
#at_before_file_lines ⇒ Object
10
|
# File 'lib/innate/filelines.rb', line 10
alias_method :at_before_file_lines, :[]
|
54
55
56
57
|
# File 'lib/innate/filelines.rb', line 54
def collect
load_all
super
end
|
41
42
43
44
|
# File 'lib/innate/filelines.rb', line 41
def each
load_all
super
end
|
46
47
48
|
# File 'lib/innate/filelines.rb', line 46
def first
at 0
end
|
50
51
52
|
# File 'lib/innate/filelines.rb', line 50
def last
at length - 1
end
|
26
27
28
29
|
# File 'lib/innate/filelines.rb', line 26
def length
init
super
end
|
31
32
33
34
|
# File 'lib/innate/filelines.rb', line 31
def size
init
super
end
|
#values_at(*a) ⇒ Object
36
37
38
39
|
# File 'lib/innate/filelines.rb', line 36
def values_at(*a)
load(*a)
super
end
|