Class: Sitepress::Data::Collection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/sitepress/data.rb

Overview

Wraps an array and returns managed elements

Instance Method Summary collapse

Constructor Details

#initialize(array) ⇒ Collection

Returns a new instance of Collection.



30
31
32
# File 'lib/sitepress/data.rb', line 30

def initialize(array)
  @array = array.map { |element| Data.manage(element) }
end

Instance Method Details

#unmanageObject



34
35
36
# File 'lib/sitepress/data.rb', line 34

def unmanage
  @array.map { |value| Data.unmanage(value) }
end