Class: Shutterbug::Storage::FileStorage

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, file_handler) ⇒ FileStorage

Returns a new instance of FileStorage.



8
9
10
11
# File 'lib/shutterbug/storage/file_storage.rb', line 8

def initialize(filename, file_handler)
  @filename = Configuration.instance.fs_path_for(filename)
  @url = file_handler.urlify(filename)
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



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

def config
  @config
end

#filenameObject

Returns the value of attribute filename.



4
5
6
# File 'lib/shutterbug/storage/file_storage.rb', line 4

def filename
  @filename
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/shutterbug/storage/file_storage.rb', line 6

def url
  @url
end

Instance Method Details

#get_contentObject



13
14
15
16
# File 'lib/shutterbug/storage/file_storage.rb', line 13

def get_content
  file = File.open(@filename, 'r')
  return file
end