Class: Configuration::RequestState::Images
- Inherits:
-
Hash
- Object
- Hash
- Configuration::RequestState::Images
- Defined in:
- lib/httpimagestore/configuration/handler.rb
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, image) ⇒ Object
-
#initialize(memory_limit) ⇒ Images
constructor
A new instance of Images.
Constructor Details
#initialize(memory_limit) ⇒ Images
Returns a new instance of Images.
46 47 48 49 |
# File 'lib/httpimagestore/configuration/handler.rb', line 46 def initialize(memory_limit) @memory_limit = memory_limit super end |
Instance Method Details
#[](name) ⇒ Object
58 59 60 |
# File 'lib/httpimagestore/configuration/handler.rb', line 58 def [](name) fetch(name){|image_name| raise ImageNotLoadedError.new(image_name)} end |
#[]=(name, image) ⇒ Object
51 52 53 54 55 56 |
# File 'lib/httpimagestore/configuration/handler.rb', line 51 def []=(name, image) if member?(name) @memory_limit.return fetch(name).data.bytesize end super end |