verboice 0.6.0 → 0.7.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 +19 -1
  2. metadata +2 -2
@@ -70,6 +70,15 @@ class Verboice
70
70
  get_json "/api/calls/#{id}/redirect"
71
71
  end
72
72
 
73
+ def channel(name)
74
+ get("/api/channels/#{name}.json") do |response, error|
75
+ handle_channel_error error if error
76
+
77
+ channel = JSON.parse response.body
78
+ with_indifferent_access channel
79
+ end
80
+ end
81
+
73
82
  def create_channel(channel)
74
83
  post "/api/channels.json", channel.to_json do |response, error|
75
84
  handle_channel_error error if error
@@ -79,7 +88,16 @@ class Verboice
79
88
  end
80
89
  end
81
90
 
82
- # Deletes a chnanel given its name.
91
+ def update_channel(channel, name = channel['name'])
92
+ put "/api/channels/#{name}.json", channel.to_json do |response, error|
93
+ handle_channel_error error if error
94
+
95
+ channel = JSON.parse response.body
96
+ with_indifferent_access channel
97
+ end
98
+ end
99
+
100
+ # Deletes a channel given its name.
83
101
  #
84
102
  # Raises Verboice::Exception if something goes wrong.
85
103
  def delete_channel(name)
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.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  requirements: []
73
73
  rubyforge_project:
74
- rubygems_version: 1.8.23
74
+ rubygems_version: 1.8.25
75
75
  signing_key:
76
76
  specification_version: 3
77
77
  summary: Access the Verboice API in ruby