Class: Pulitzer::CreatePostTypeFreeFormSections
- Inherits:
-
Object
- Object
- Pulitzer::CreatePostTypeFreeFormSections
- Defined in:
- app/interactions/pulitzer/create_post_type_free_form_sections.rb
Instance Attribute Summary collapse
-
#ffst ⇒ Object
Returns the value of attribute ffst.
-
#old_label ⇒ Object
Returns the value of attribute old_label.
-
#post_type_version ⇒ Object
Returns the value of attribute post_type_version.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(ffst) ⇒ CreatePostTypeFreeFormSections
constructor
A new instance of CreatePostTypeFreeFormSections.
Constructor Details
#initialize(ffst) ⇒ CreatePostTypeFreeFormSections
Returns a new instance of CreatePostTypeFreeFormSections.
4 5 6 7 |
# File 'app/interactions/pulitzer/create_post_type_free_form_sections.rb', line 4 def initialize(ffst) self.post_type_version = ffst.post_type_version self.ffst = ffst end |
Instance Attribute Details
#ffst ⇒ Object
Returns the value of attribute ffst.
2 3 4 |
# File 'app/interactions/pulitzer/create_post_type_free_form_sections.rb', line 2 def ffst @ffst end |
#old_label ⇒ Object
Returns the value of attribute old_label.
2 3 4 |
# File 'app/interactions/pulitzer/create_post_type_free_form_sections.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_free_form_sections.rb', line 2 def post_type_version @post_type_version end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/interactions/pulitzer/create_post_type_free_form_sections.rb', line 9 def call post_type_version.posts.each do |post| if post.preview_version post.preview_version.free_form_sections.create do |ffs| ffs.name = ffst.name ffs.free_form_section_type = ffst end end end end |