Sha256: a53ae594f7d343872e1fe4d54ac52adcd810c8f06e4ab538cce7e369ff0075c3

Contents?: true

Size: 868 Bytes

Versions: 10

Compression:

Stored size: 868 Bytes

Contents

module RedboothRuby
  module Operations
    module Update
      module ClassMethods
        # Updates a object
        # @param [Integer] id The id of the object that should be updated
        # @param [Hash] attributes The attributes that should be updated
        def update(attributes = {})
          id = attributes.delete(:id)
          session = attributes.delete(:session)
          response = RedboothRuby.request(:put,
                                          nil,
                                          api_member_url(id, :updated),
                                          attributes,
                                          options_for_request(session: session)
                                         )
          new(response.data)
        end
      end

      def self.included(base)
        base.extend(ClassMethods)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
redbooth-ruby-0.2.3 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.2.2 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.2.1 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.2.0 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.1.4 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.1.3 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.1.1 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.1.0 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.0.5 lib/redbooth-ruby/operations/update.rb
redbooth-ruby-0.0.4 lib/redbooth-ruby/operations/update.rb