Class: Array

Inherits:
Object show all
Defined in:
lib/structure_mapper.rb

Instance Method Summary collapse

Instance Method Details

#from_structure(data) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/structure_mapper.rb', line 16

def from_structure data
  inner_type=first
  if inner_type && data
    data.map{|x| inner_type.from_structure x}
  else
    data
  end

end

#to_structureObject



26
27
28
# File 'lib/structure_mapper.rb', line 26

def to_structure
  map{|v| v.to_structure}
end