Completed
Push — master ( 443a9a...4b1fad )
by John
01:14 queued 12s
created

Messages.create()   A

Complexity

Conditions 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 12
rs 9.4285
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