Class: DatoDump::FieldTypeDumper::File

Inherits:
Object
  • Object
show all
Defined in:
lib/dato_dump/field_type_dumper/file.rb

Class Method Summary collapse

Class Method Details

.dump(value, _repo) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dato_dump/field_type_dumper/file.rb', line 6

def self.dump(value, _repo)
  url = Imgix::Client.new(
    host: 'dato-images.imgix.net',
    secure: true
  )
    .path(value[:path])
    .to_url

  {
    format: value[:format],
    size: value[:size],
    url: url
  }
end