class Oneview::Api::Contacts

Public Instance Methods

create(data) click to toggle source
# File lib/oneview/api/contacts.rb, line 8
def create(data)
  return parse_response(self.class.post("/", body: build_body(data), headers: header)) if data.is_a?(Hash)
  return parse_response(self.class.post("/", body: build_body(data.as_parameter), headers: header)) if data.is_a?(Oneview::Entity::Contact)

  raise ArgumentError
end
Also aliased as: new
new(data)
Alias for: create
update(id, data) click to toggle source
# File lib/oneview/api/contacts.rb, line 16
def update(id, data)
  return parse_response(self.class.patch("/" + id, body: build_body(data), headers: header)) if data.is_a?(Hash)
  return parse_response(self.class.patch("/" + id, body: build_body(data.as_parameter), headers: header)) if data.is_a?(Oneview::Entity::Contact)

  raise ArgumentError
end

Private Instance Methods

build_body(parameters) click to toggle source
Calls superclass method
# File lib/oneview/api/contacts.rb, line 25
def build_body(parameters)
  super(contact: parameters)
end