Class: Shutterbug::Service::RackFile

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

Direct Known Subclasses

HtmlFile, JSFile, PngFile

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ RackFile

Returns a new instance of RackFile.



5
6
7
# File 'lib/shutterbug/service.rb', line 5

def initialize(file)
  @stream_file = file
end

Instance Method Details

#each(&blk) ⇒ Object



14
15
16
17
18
# File 'lib/shutterbug/service.rb', line 14

def each(&blk)
  @stream_file.each(&blk)
ensure
  @stream_file.close
end

#openObject



9
10
11
12
# File 'lib/shutterbug/service.rb', line 9

def open
  @stream_file.open
  @stream_file.rewind
end

#sizeObject



20
21
22
# File 'lib/shutterbug/service.rb', line 20

def size
  @stream_file.size
end