Sha256: 12482d1ecb8a0a222ca20e1cf33837b5c94800bdfce9e84c7efad8c194b27899
Contents?: true
Size: 1.55 KB
Versions: 2
Compression:
Stored size: 1.55 KB
Contents
# Nexmos [](https://travis-ci.org/dotpromo/nexmos)[](https://codeclimate.com/github/dotpromo/nexmos)[](https://coveralls.io/r/dotpromo/nexmos) Nexmo API wrapper ## Installation Add this line to your application's Gemfile: gem 'nexmos' And then execute: $ bundle Or install it yourself as: $ gem install nexmos ## Usage ### Send text message ```ruby # Nexmos specific client client = ::Nexmos::Message.new('api-key', 'api-secret') # get result from Nexmo res = client.send_text(from: 'your number', to: '+1234567890', text: 'Hello world!') # check if send is success if res.success? puts "ok" else puts "fail" end ``` ### Get balance ```ruby client = ::Nexmos::Account.new('api-key', 'api-secret') res = client.get_balance my_balance = res.value ``` ## Rails integration You can create `config/initializer/nexmos.rb` file with next content: ```ruby Nexmos.setup do |n| n.api_key = 'api_key' n.api_secret = 'api_secret' end ``` And then you can call all clients without providing key and secret. ## More details about api calls More details about api calls you can found in the lib/api.yml file. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nexmos-0.3 | README.md |
nexmos-0.2 | README.md |