Class: ImageLoader

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
app/models/image_loader.rb

Instance Attribute Summary collapse

Delegated Instance Attributes collapse

Instance Method Summary collapse

Constructor Details

#initializeImageLoader

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_classObject (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

#findObject

Alias for @image_class#find

Returns:

  • (Object)

    @image_class#find

See Also:



12
# File 'app/models/image_loader.rb', line 12

delegate :find, to: :@image_class