Class: ButterCMS::Parsers::PostObject
- Inherits:
-
Object
- Object
- ButterCMS::Parsers::PostObject
- Defined in:
- lib/butter_cms/parsers/post_object.rb
Class Method Summary collapse
-
.call(post_attributes) ⇒ ButterCMS::Post
Returns the new instance of post with the associations included.
Class Method Details
.call(post_attributes) ⇒ ButterCMS::Post
Returns the new instance of post with the associations included
7 8 9 10 11 12 13 14 15 |
# File 'lib/butter_cms/parsers/post_object.rb', line 7 def self.call(post_attributes) updated_post_attributes = { 'tags' => ::ButterCMS::Parsers::TagsObjects.call(post_attributes.delete('tags')), 'categories' => ::ButterCMS::Parsers::CategoriesObjects.call(post_attributes.delete('categories')), 'author' => ::ButterCMS::Parsers::AuthorObject.call(post_attributes.delete('author')) } ::ButterCMS::Post.new(post_attributes.merge(updated_post_attributes)) end |