Sha256: c8cb4dcd7bf618ff1a0a62395b9bdc5bbf7eaf079caaa49f53062ba2d5d3aba3

Contents?: true

Size: 396 Bytes

Versions: 13

Compression:

Stored size: 396 Bytes

Contents

class Pulitzer::UpdateSingletonPost
  attr_accessor :post_type, :title

  def initialize(post_type, title)
    self.post_type = post_type
    self.title = title
  end

  def call
    if post_type.singular?
      unless post_type.singleton_post?
        Pulitzer::CreateSingletonPost.new(post_type).call
      else
        post_type.singleton_post.update(title: title)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pulitzer-0.14.4 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.14.3 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.14.2 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.14.1 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.14.0 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.13.1 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.12.5 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.13.0 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.12.4 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.12.3 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.12.2 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.12.1 app/interactions/pulitzer/update_singleton_post.rb
pulitzer-0.12.0 app/interactions/pulitzer/update_singleton_post.rb