Method: CollinsShell::State#update

Defined in:
lib/collins_shell/state.rb

#update(state) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/collins_shell/state.rb', line 78

def update state
  name = options.name.upcase if options.name?
  label = options.label if options.label?
  desc = options.description if options.description?
  status = options.status if options.status?
  call_collins get_collins_client, "state_update!" do |client|
    opts = {
      :name => name, :label => label, :status => status,
      :description => desc
    }
    if client.state_update!(state, opts) then
      say_success "Successfully updated state '#{state}'"
    else
      say_error "Failed creating state '#{state}'"
    end
  end
end