class Vhx::Customer

Public Instance Methods

add_product(identifier) click to toggle source
# File lib/vhx/objects/customer.rb, line 8
def add_product(identifier)
  response = Vhx.connection.put do |req|
    req.url('/customers/' + self.id.to_s + '/products')
    req.body = { product: get_hypermedia(identifier, 'Product') }
  end

  self.class.new(response.body)
end
remove_product(identifier) click to toggle source
# File lib/vhx/objects/customer.rb, line 17
def remove_product(identifier)
  response = Vhx.connection.delete do |req|
    req.url('/customers/' + self.id.to_s + '/products')
    req.body = { product: get_hypermedia(identifier, 'Product') }
  end

  self.class.new(response.body)
end