lib/servicenow/change.rb in servicenow-1.1.2 vs lib/servicenow/change.rb in servicenow-1.1.3

- old
+ new

@@ -1,9 +1,12 @@ require 'ostruct' module Servicenow + # This class represents a ServiceNow Change. A Change is a local + # representation of the state of the remote. For writing operations, the + # local is updated, and then a request to update the remote is sent class Change < OpenStruct @_client = nil # @param [String] notes the notes to post @@ -14,11 +17,11 @@ query = { work_notes: notes } - response = client.send_request(url, query, :patch) + client.send_request(url, query, :patch) change end # @param [Hash] extra options to override default query, or non-standard @@ -31,11 +34,11 @@ query = { state: states['work in progress'], work_start: Time.now.utc }.merge(extra) - response = client.send_request(url, query, :patch) + client.send_request(url, query, :patch) change end # @param [Hash] extra options to override default query, or non-standard @@ -48,11 +51,11 @@ query = { state: states['work complete'], work_end: Time.now.utc }.merge(extra) - response = client.send_request(url, query, :patch) + client.send_request(url, query, :patch) change end # This is a convenience method only. It cannot be used to reload a Change @@ -68,23 +71,21 @@ private def client - if @_client.nil? - @_client = Servicenow::Client.new - end + @_client = Servicenow::Client.new if @_client.nil? @_client end def states { 'open' => 1, 'work in progress' => 2, 'work complete' => 11, 'work incomplete' => 4, - 'waiting on user' => -5, + 'waiting on user' => -5 } end def completion_codes \ No newline at end of file