Class: Agave::Local::FieldType::Gallery

Inherits:
Array
  • Object
show all
Defined in:
lib/agave/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



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

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



17
18
19
# File 'lib/agave/local/field_type/gallery.rb', line 17

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