Class: ImageLoader
- Inherits:
-
Object
- Object
- ImageLoader
- Includes:
- Singleton
- Defined in:
- app/models/image_loader.rb
Instance Attribute Summary collapse
-
#image_class ⇒ Object
readonly
Returns the value of attribute image_class.
Delegated Instance Attributes collapse
-
#find ⇒ Object
Alias for @image_class#find.
Instance Method Summary collapse
-
#initialize ⇒ ImageLoader
constructor
A new instance of ImageLoader.
Constructor Details
#initialize ⇒ ImageLoader
Returns a new instance of ImageLoader.
8 9 10 |
# File 'app/models/image_loader.rb', line 8 def initialize @image_class = Rails.env.production? || ENV['LOCAL_IMAGE'] == 'y' ? Image.friendly : Api::Image end |
Instance Attribute Details
#image_class ⇒ Object (readonly)
Returns the value of attribute image_class.
6 7 8 |
# File 'app/models/image_loader.rb', line 6 def image_class @image_class end |
Instance Method Details
#find ⇒ Object
Alias for @image_class#find
12 |
# File 'app/models/image_loader.rb', line 12 delegate :find, to: :@image_class |