Module: Layer::Operations::Patch

Included in:
Conversation
Defined in:
lib/layer/operations/patch.rb

Instance Method Summary collapse

Instance Method Details

#attributes=(attributes) ⇒ Layer::Patch::Hash

Updates the resource's attributes to the given ones

Parameters:

  • attributes (Hash)

    the new attributes

Returns:



19
20
21
# File 'lib/layer/operations/patch.rb', line 19

def attributes=(attributes)
  @attributes = Layer::Patch::Hash.new(patch, attributes)
end

#saveBoolean

Creates the resource with the given attributes

Returns:

  • (Boolean)

    whether saving was successful

Raises:



9
10
11
12
13
# File 'lib/layer/operations/patch.rb', line 9

def save
  client.patch(url, patch.operations)
  patch.reset
  true
end