Class: Mosaico::UploadedImage

Inherits:
Image
  • Object
show all
Defined in:
app/models/mosaico/uploaded_image.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Image

#content_type

Class Method Details

.backendObject



4
5
6
# File 'app/models/mosaico/uploaded_image.rb', line 4

def backend
  Mosaico::Engine.config.image_backend
end

Instance Method Details

#to_jsonObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/models/mosaico/uploaded_image.rb', line 9

def to_json
  {
    deleteType: 'DELETE',
    deleteUrl: url,
    name: file,
    originalName: file,
    size: filesize,
    thumbnailUrl: url,
    type: nil,
    url: url
  }
end

#urlObject



22
23
24
# File 'app/models/mosaico/uploaded_image.rb', line 22

def url
  Mosaico::Engine.routes.url_helpers.mosaico_image_path(self)
end