Class: Shutterbug::BugFile
- Inherits:
-
Object
- Object
- Shutterbug::BugFile
show all
- Defined in:
- lib/shutterbug/bug_file.rb
Instance Method Summary
collapse
Constructor Details
#initialize(filename) ⇒ BugFile
Returns a new instance of BugFile.
3
4
5
|
# File 'lib/shutterbug/bug_file.rb', line 3
def initialize(filename)
@filename = filename
end
|
Instance Method Details
#each(&blk) ⇒ Object
12
13
14
15
16
|
# File 'lib/shutterbug/bug_file.rb', line 12
def each(&blk)
@stream_file.each(&blk)
ensure
@stream_file.close
end
|
#open ⇒ Object
7
8
9
10
|
# File 'lib/shutterbug/bug_file.rb', line 7
def open
@stream_file = File.open(@filename, 'r')
@stream_file.rewind
end
|
#size ⇒ Object
18
19
20
|
# File 'lib/shutterbug/bug_file.rb', line 18
def size
@stream_file.size
end
|