Class: FancyHands::Incoming

Inherits:
Object
  • Object
show all
Defined in:
lib/fancyhands/v1/incoming.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Incoming

Returns a new instance of Incoming.



6
7
8
# File 'lib/fancyhands/v1/incoming.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#delete(phone_number = '', key = '') ⇒ Object



35
36
37
38
39
40
41
# File 'lib/fancyhands/v1/incoming.rb', line 35

def delete(phone_number='', key='')
  data = {
    :phone_number => phone_number,
    :key => key
  }
  return @client.request.delete("call/incoming", data)
end

#get(phone_number = "", key = "", cursor = "") ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/fancyhands/v1/incoming.rb', line 18

def get(phone_number="", key="", cursor="")
  data = {
    :phone_number => phone_number,
    :key => key,
    :cursor => cursor
  }
  return @client.request.get("call/incoming", data)
end

#post(phone_number = "", conversation = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/fancyhands/v1/incoming.rb', line 10

def post(phone_number="", conversation={})
  data = {
    :phone_number => phone_number,
    :conversation => JSON.generate(conversation)
  }
  return @client.request.post("call/incoming", data)
end

#put(phone_number = nil, key = nil, conversation = {}) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/fancyhands/v1/incoming.rb', line 27

def put(phone_number=nil, key=nil, conversation={})
  data = {
    :phone_number => phone_number,
    :conversation =>  JSON.generate(conversation)
  }
  return @client.request.put("call/incoming", data)
end