Class: Pulitzer::CreatePostTypeContentElements
- Inherits:
-
Object
- Object
- Pulitzer::CreatePostTypeContentElements
- Defined in:
- app/interactions/pulitzer/create_post_type_content_elements.rb
Instance Attribute Summary collapse
-
#old_label ⇒ Object
Returns the value of attribute old_label.
-
#post_type_version ⇒ Object
Returns the value of attribute post_type_version.
-
#ptcet ⇒ Object
Returns the value of attribute ptcet.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(ptcet) ⇒ CreatePostTypeContentElements
constructor
A new instance of CreatePostTypeContentElements.
Constructor Details
#initialize(ptcet) ⇒ CreatePostTypeContentElements
Returns a new instance of CreatePostTypeContentElements.
4 5 6 7 |
# File 'app/interactions/pulitzer/create_post_type_content_elements.rb', line 4 def initialize(ptcet) self.post_type_version = ptcet.post_type_version self.ptcet = ptcet end |
Instance Attribute Details
#old_label ⇒ Object
Returns the value of attribute old_label.
2 3 4 |
# File 'app/interactions/pulitzer/create_post_type_content_elements.rb', line 2 def old_label @old_label end |
#post_type_version ⇒ Object
Returns the value of attribute post_type_version.
2 3 4 |
# File 'app/interactions/pulitzer/create_post_type_content_elements.rb', line 2 def post_type_version @post_type_version end |
#ptcet ⇒ Object
Returns the value of attribute ptcet.
2 3 4 |
# File 'app/interactions/pulitzer/create_post_type_content_elements.rb', line 2 def ptcet @ptcet end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/interactions/pulitzer/create_post_type_content_elements.rb', line 9 def call post_type_version.posts.each do |post| post.preview_version.content_elements.create do |ce| ce.label = ptcet.label ce.height = ptcet.height ce.width = ptcet.width ce.text_editor = ptcet.text_editor ce.content_element_type = ptcet.content_element_type ce.post_type_content_element_type = ptcet end end end |