Class: Admin::ImageSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Includes:
DynamicImage::Helper
Defined in:
app/serializers/admin/image_serializer.rb

Instance Method Summary collapse

Instance Method Details

#alternativeObject


12
13
14
# File 'app/serializers/admin/image_serializer.rb', line 12

def alternative
  localized_attribute(:alternative)
end

#captionObject


16
17
18
# File 'app/serializers/admin/image_serializer.rb', line 16

def caption
  localized_attribute(:caption)
end

#cropped_urlObject


32
33
34
35
36
37
38
39
# File 'app/serializers/admin/image_serializer.rb', line 32

def cropped_url
  dynamic_image_path(
    object,
    size: "1200x1200",
    crop: false,
    upscale: false
  )
end

#original_urlObject


20
21
22
# File 'app/serializers/admin/image_serializer.rb', line 20

def original_url
  original_dynamic_image_path(object)
end

#thumbnail_urlObject


24
25
26
27
28
29
30
# File 'app/serializers/admin/image_serializer.rb', line 24

def thumbnail_url
  dynamic_image_path(
    object,
    size: "500x",
    upscale: false
  )
end

#uncropped_urlObject


41
42
43
44
45
46
47
# File 'app/serializers/admin/image_serializer.rb', line 41

def uncropped_url
  uncropped_dynamic_image_path(
    object,
    size: "2000x2000",
    upscale: false
  )
end