Class: Pulitzer::PostsController::PreviewRebuilder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(post) ⇒ PreviewRebuilder

Returns a new instance of PreviewRebuilder.



4
5
6
# File 'app/interactions/pulitzer/posts_controller/preview_rebuilder.rb', line 4

def initialize(post)
  @post = post
end

Instance Attribute Details

#processing_versionObject

Returns the value of attribute processing_version.



2
3
4
# File 'app/interactions/pulitzer/posts_controller/preview_rebuilder.rb', line 2

def processing_version
  @processing_version
end

Instance Method Details

#rebuildObject



8
9
10
11
12
# File 'app/interactions/pulitzer/posts_controller/preview_rebuilder.rb', line 8

def rebuild
  @processing_version = @post.create_processing_version
  Pulitzer::CloneVersionJob.perform_later(@post.active_version)
  instance_eval(&Pulitzer.publish_callback) unless Pulitzer.skip_publish_callback?
end