module Layer::Operations::Patch

Public Instance Methods

attributes=(attributes) click to toggle source

Updates the resource's attributes to the given ones

@param [Hash] attributes the new attributes @return [Layer::Patch::Hash] the resources new attributes

# File lib/layer/operations/patch.rb, line 19
def attributes=(attributes)
  @attributes = Layer::Patch::Hash.new(patch, attributes)
end
save() click to toggle source

Creates the resource with the given attributes

@return [Boolean] whether saving was successful @raise [Layer::Exceptions::Exception] a subclass of Layer::Exceptions::Exception describing the error

# File lib/layer/operations/patch.rb, line 9
def save
  client.patch(url, patch.operations.dup)
  patch.reset
  true
end

Private Instance Methods

patch() click to toggle source
# File lib/layer/operations/patch.rb, line 25
def patch
  @patch ||= Layer::Patch.new
end