Sha256: f450255e5c0d8d1e58badc7529a4da5f65557304651b8fc7caf8853c49a34c48
Contents?: true
Size: 381 Bytes
Versions: 49
Compression:
Stored size: 381 Bytes
Contents
class Pulitzer::CreateSingletonPost 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? && !post_type.singleton_post? singleton_post = post_type.posts.create(title: title) Pulitzer::CreatePostContentElements.new(singleton_post).call end end end
Version data entries
49 entries across 49 versions & 1 rubygems