Class: Dato::Local::FieldType::Gallery

Inherits:
Array
  • Object
show all
Defined in:
lib/dato/local/field_type/gallery.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Array

#deep_stringify_keys

Class Method Details

.parse(value, repo) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/dato/local/field_type/gallery.rb', line 9

def self.parse(value, repo)
  images = if value
             value.map { |image| FieldType::File.parse(image, repo) }
           else
             []
           end
  new(images)
end

Instance Method Details

#to_hash(max_depth = 3, current_depth = 0) ⇒ Object



18
19
20
# File 'lib/dato/local/field_type/gallery.rb', line 18

def to_hash(max_depth = 3, current_depth = 0)
  map { |item| item.to_hash(max_depth, current_depth) }
end