Class: Shutterbug::Storage::FileStorage
- Inherits:
-
Object
- Object
- Shutterbug::Storage::FileStorage
- Defined in:
- lib/shutterbug/storage/file_storage.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #get_content ⇒ Object
-
#initialize(filename, file_handler) ⇒ FileStorage
constructor
A new instance of FileStorage.
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
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/shutterbug/storage/file_storage.rb', line 5 def config @config end |
#filename ⇒ Object
Returns the value of attribute filename.
4 5 6 |
# File 'lib/shutterbug/storage/file_storage.rb', line 4 def filename @filename end |
#url ⇒ Object
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_content ⇒ Object
13 14 15 16 |
# File 'lib/shutterbug/storage/file_storage.rb', line 13 def get_content file = File.open(@filename, 'r') return file end |