Class: Pulitzer::PostsController::Export
- Inherits:
-
Object
- Object
- Pulitzer::PostsController::Export
- Defined in:
- app/interactions/pulitzer/posts_controller/export.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(post) ⇒ Export
constructor
A new instance of Export.
Constructor Details
#initialize(post) ⇒ Export
Returns a new instance of Export.
3 4 5 |
# File 'app/interactions/pulitzer/posts_controller/export.rb', line 3 def initialize(post) @post = post end |
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 |
# File 'app/interactions/pulitzer/posts_controller/export.rb', line 7 def call json_hash = @post.as_json( Pulitzer::Post.export_config ) Pulitzer::Post.convert_hash_to_nested(json_hash).to_json end |