Class: Actions::ForemanPatch::Window::Publish

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/foreman_patch/window/publish.rb

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



25
26
27
# File 'app/lib/actions/foreman_patch/window/publish.rb', line 25

def humanized_name
  _('Publish ticket for %s') % window.name
end

#plan(window) ⇒ Object



6
7
8
9
# File 'app/lib/actions/foreman_patch/window/publish.rb', line 6

def plan(window)
  input.update serialize_args(window: window)
  plan_self
end

#runObject



11
12
13
14
15
16
17
18
19
# File 'app/lib/actions/foreman_patch/window/publish.rb', line 11

def run
  ticket = window.ticket

  input.update(payload: ticket.payload.raw.compact)

  ticket.save

  output.update(response: ticket.response)
end

#windowObject



21
22
23
# File 'app/lib/actions/foreman_patch/window/publish.rb', line 21

def window
  @window ||= ::ForemanPatch::Window.find(input[:window][:id])
end