verboice 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/verboice.rb +20 -13
  2. metadata +16 -6
data/lib/verboice.rb CHANGED
@@ -48,7 +48,11 @@ class Verboice
48
48
  end
49
49
 
50
50
  def call_state id
51
- get_json "/api/call/#{id}/state"
51
+ get_json "/api/calls/#{id}/state"
52
+ end
53
+
54
+ def call_redirect id
55
+ get_json "/api/calls/#{id}/redirect"
52
56
  end
53
57
 
54
58
  def create_channel(channel)
@@ -75,30 +79,30 @@ class Verboice
75
79
  get_json "/api/channels.json"
76
80
  end
77
81
 
78
- def call_queues
79
- get_json "/api/call_queues.json"
82
+ def schedules(project_id)
83
+ get_json "/api/projects/#{project_id}/schedules.json"
80
84
  end
81
85
 
82
- def call_queue(name)
83
- get_json "/api/call_queues/#{name}.json"
86
+ def schedule(project_id, name)
87
+ get_json "/api/projects/#{project_id}/schedules/#{name}.json"
84
88
  end
85
89
 
86
- def create_call_queue(call_queue)
87
- post "/api/call_queues", call_queue.to_json do |response, error|
90
+ def create_schedule(project_id, schedule)
91
+ post "/api/projects/#{project_id}/schedules", schedule.to_json do |response, error|
88
92
  raise Verboice::Exception.new error.message if error
89
93
  response
90
94
  end
91
95
  end
92
96
 
93
- def update_call_queue(name, call_queue)
94
- put "/api/call_queues/#{name}", call_queue.to_json do |response, error|
97
+ def update_schedule(project_id, name, schedule)
98
+ put "/api/projects/#{project_id}/schedules/#{name}", schedule.to_json do |response, error|
95
99
  raise Verboice::Exception.new error.message if error
96
100
  response
97
101
  end
98
102
  end
99
103
 
100
- def delete_call_queue(name)
101
- delete "/api/call_queues/#{name}" do |response, error|
104
+ def delete_schedule(project_id, name)
105
+ delete "/api/projects/#{project_id}/schedules/#{name}" do |response, error|
102
106
  raise Verboice::Exception.new error.message if error
103
107
  response
104
108
  end
@@ -171,7 +175,10 @@ class Verboice
171
175
  end
172
176
 
173
177
  def with_indifferent_access(hash)
174
- hash = hash.with_indifferent_access if hash.respond_to? :with_indifferent_access
175
- hash
178
+ if hash.respond_to? :with_indifferent_access
179
+ hash.with_indifferent_access
180
+ else
181
+ hash
182
+ end
176
183
  end
177
184
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verboice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &70150116524760 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70150116524760
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: json
27
- requirement: &70150116524260 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70150116524260
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  description: Access the Verboice API in ruby.
37
47
  email: aromero@manas.com.ar
38
48
  executables: []
@@ -61,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
71
  version: '0'
62
72
  requirements: []
63
73
  rubyforge_project:
64
- rubygems_version: 1.8.11
74
+ rubygems_version: 1.8.21
65
75
  signing_key:
66
76
  specification_version: 3
67
77
  summary: Access the Verboice API in ruby