Class: Blogo::PreviewPostService
- Inherits:
-
BasePostService
- Object
- BasePostService
- Blogo::PreviewPostService
- Defined in:
- app/services/blogo/preview_post_service.rb
Overview
Creates new model of posts applying post params on it so it can be previewed.
Constant Summary
Constants inherited from BasePostService
Instance Method Summary collapse
-
#initialize(user, params) ⇒ PreviewPostService
constructor
A new instance of PreviewPostService.
-
#preview ⇒ Blogo::Post
Assign post attributes and return a post.
Constructor Details
#initialize(user, params) ⇒ PreviewPostService
Returns a new instance of PreviewPostService.
6 7 8 9 |
# File 'app/services/blogo/preview_post_service.rb', line 6 def initialize(user, params) @post = user.posts.build @post_attrs = params end |
Instance Method Details
#preview ⇒ Blogo::Post
Assign post attributes and return a post.
14 15 16 17 |
# File 'app/services/blogo/preview_post_service.rb', line 14 def preview assign_attributes @post end |