Class: Pulitzer::PostsController::Export

Inherits:
Object
  • Object
show all
Defined in:
app/interactions/pulitzer/posts_controller/export.rb

Instance Method Summary collapse

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

#callObject



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