Total Complexity | 2 |
Total Lines | 17 |
Duplicated Lines | 0 % |
1 | module RingCentralSdk::Helpers |
||
2 | class Messages |
||
3 | def initialize(rcapi) |
||
4 | @rcapi = rcapi |
||
5 | end |
||
6 | def create(opts) |
||
7 | response = @rcapi.client.post do |req| |
||
8 | req.url 'account/~/extension/~/sms' |
||
9 | req.headers['Content-Type'] = 'application/json' |
||
10 | req.body = { |
||
11 | :from => { :phoneNumber => opts[:from].to_s }, |
||
12 | :to => [ { :phoneNumber => opts[:to].to_s } ], |
||
13 | :text => opts[:text].to_s |
||
14 | } |
||
15 | end |
||
16 | return response |
||
17 | end |
||
18 | end |
||
19 | end |