Method: Orchestrate::Client#put
- Defined in:
- lib/orchestrate/client.rb
permalink #put(collection, key, body, condition = nil) ⇒ Object Also known as: put_if_unmodified
Updates the value associated with a key. If the key does not currently have a value, will create the value.
151 152 153 154 155 156 157 158 159 |
# File 'lib/orchestrate/client.rb', line 151 def put(collection, key, body, condition=nil) headers={} if condition.is_a?(String) headers['If-Match'] = API::Helpers.format_ref(condition) elsif condition == false headers['If-None-Match'] = '"*"' end send_request :put, [collection, key], { body: body, headers: headers, response: API::ItemResponse } end |