Class: BandwidthIris::PortOut

Inherits:
Object
  • Object
show all
Extended by:
ClientWrapper
Includes:
ApiItem
Defined in:
lib/bandwidth-iris/port_out.rb

Instance Method Summary collapse

Methods included from ClientWrapper

wrap_client_arg

Methods included from ApiItem

#[], #[]=, #initialize, #to_data

Instance Method Details

#add_notes(note) ⇒ Object



18
19
20
21
22
# File 'lib/bandwidth-iris/port_out.rb', line 18

def add_notes(note)
  r = @client.make_request(:post, "#{@client.(PORT_OUT_PATH)}/#{id}/notes", {:note => note})
  note_id = Client.get_id_from_location_header(r[1][:location])
  (get_notes().select {|n| n[:id].to_s == note_id }).first
end

#get_notesObject



8
9
10
11
12
13
14
15
16
# File 'lib/bandwidth-iris/port_out.rb', line 8

def get_notes()
  list = @client.make_request(:get, "#{@client.(PORT_OUT_PATH)}/#{id}/notes")[0][:note]
  return [] if !list
  if list.is_a?(Array)
    list
  else
    [list]
  end
end