Class: Pulitzer::PostTypeVersion::Retire

Inherits:
Object
  • Object
show all
Includes:
StateMachine::Transition
Defined in:
app/services/pulitzer/post_type_version/retire.rb

Instance Method Summary collapse

Constructor Details

#initialize(post_type_version) ⇒ Retire

Returns a new instance of Retire.



8
9
10
11
12
# File 'app/services/pulitzer/post_type_version/retire.rb', line 8

def initialize(post_type_version)
  @post_type_version = post_type_version
  self.object = @post_type_version
  self.errors = ActiveModel::Errors.new(self)
end

Instance Method Details

#retireObject



14
15
16
17
18
# File 'app/services/pulitzer/post_type_version/retire.rb', line 14

def retire
  self.validate_transition!
  update_status
  return true
end