Class: Pulitzer::CreatePartialContentElements

Inherits:
Object
  • Object
show all
Defined in:
app/interactions/pulitzer/create_partial_content_elements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(partial) ⇒ CreatePartialContentElements

Returns a new instance of CreatePartialContentElements.



4
5
6
# File 'app/interactions/pulitzer/create_partial_content_elements.rb', line 4

def initialize(partial)
  self.partial = partial
end

Instance Attribute Details

#partialObject

Returns the value of attribute partial.



2
3
4
# File 'app/interactions/pulitzer/create_partial_content_elements.rb', line 2

def partial
  @partial
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/interactions/pulitzer/create_partial_content_elements.rb', line 8

def call
  partial.post_type_content_element_types.each do |cet|
    partial.content_elements.create do |ce|
      ce.label                          = cet.label
      ce.height                         = cet.height
      ce.width                          = cet.width
      ce.text_editor                    = cet.text_editor
      ce.content_element_type           = cet.content_element_type
      ce.post_type_content_element_type = cet
    end
  end
end