Sha256: 49d496517342f7e852ad76d7da571b73386294055c3f84542464a66475475333

Contents?: true

Size: 354 Bytes

Versions: 3

Compression:

Stored size: 354 Bytes

Contents

module Baabedo
  module APIOperations
    module Update
      def save(params={})
        values = self.class.serialize_params(self).merge(params)

        if values.length > 0
          values.delete(:id)

          response, opts = request(:post, url, values)
          refresh_from(response, opts)
        end
        self
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
baabedo-0.0.3 lib/baabedo/api_operations/update.rb
baabedo-0.0.2 lib/baabedo/api_operations/update.rb
baabedo-0.0.1 lib/baabedo/api_operations/update.rb