Sha256: b5d5876f53d4146f6dbd15b0df4b0e02ded22b62e80e42764f523879682ee3ef

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

module OptimizePlayer
  class Account < ApiObject
    def save(opts={})
      attrs = {}
      @new_data.each do |n|
        attrs[n] = @data[n]
      end
      attrs = attrs.merge(opts)

      if attrs.any?
        response = context.client.send_request(context.entity_name, :patch, attrs)
        refresh_from(response)
      end
      self
    end

    def delete(opts={})
      response = context.client.send_request(context.entity_name, :delete)
      refresh_from(response)
      self
    end
    alias_method :destroy, :delete
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
optimizeplayer-0.0.1 lib/optimize_player/account.rb