Class: Skuby::Credit

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/skuby/credit.rb

Class Method Summary collapse

Class Method Details

.balanceObject



6
7
8
9
# File 'lib/skuby/credit.rb', line 6

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

.build_paramsObject



11
12
13
# File 'lib/skuby/credit.rb', line 11

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