Class: Pulitzer::PostTypeVersionsController::ChangeState
- Inherits:
-
Object
- Object
- Pulitzer::PostTypeVersionsController::ChangeState
- Defined in:
- app/interactions/pulitzer/post_type_versions_controller/change_state.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(ptv, state_change) ⇒ ChangeState
constructor
A new instance of ChangeState.
- #sanitize_state_change ⇒ Object
Constructor Details
#initialize(ptv, state_change) ⇒ ChangeState
Returns a new instance of ChangeState.
3 4 5 |
# File 'app/interactions/pulitzer/post_type_versions_controller/change_state.rb', line 3 def initialize(ptv,state_change) @ptv, @state_change = ptv, state_change.to_sym end |
Instance Method Details
#call ⇒ Object
7 8 9 10 |
# File 'app/interactions/pulitzer/post_type_versions_controller/change_state.rb', line 7 def call sanitize_state_change or return false @ptv.send @state_change end |
#sanitize_state_change ⇒ Object
12 13 14 |
# File 'app/interactions/pulitzer/post_type_versions_controller/change_state.rb', line 12 def sanitize_state_change return [:publish,:retire,:preview].include? @state_change end |