Sha256: 79ff9684f40f87ddb4d8b85ed1ed47c7cae08b608bae938056dad228fa02e663

Contents?: true

Size: 402 Bytes

Versions: 4

Compression:

Stored size: 402 Bytes

Contents

module Skuby
  class Credit
    include HTTParty
    base_uri 'https://gateway.skebby.it/api/send/smseasy/advanced/http.php'

    def self.balance
      response = CGI.parse(post('', body: build_params))
      response["credit_left"].first.to_f if response["status"].first == "success"
    end

    def self.build_params
      Skuby.config.to_hash.merge({'method' => 'get_credit'})
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
skuby-0.0.5 lib/skuby/credit.rb
skuby-0.0.4 lib/skuby/credit.rb
skuby-0.0.3 lib/skuby/credit.rb
skuby-0.0.2 lib/skuby/credit.rb