Class: ExetelSms::CreditCheck
- Inherits:
-
Object
- Object
- ExetelSms::CreditCheck
show all
- Extended by:
- ClassMethods
- Defined in:
- lib/credit_check.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
build_url, encode, exetel_url, matchurl?, new_reference_number, response_to_hash
Constructor Details
Returns a new instance of CreditCheck.
8
9
10
|
# File 'lib/credit_check.rb', line 8
def initialize(config)
@config = config
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
7
8
9
|
# File 'lib/credit_check.rb', line 7
def config
@config
end
|
Class Method Details
.api_path ⇒ Object
30
31
32
|
# File 'lib/credit_check.rb', line 30
def api_path
'api_sms_credit.php'
end
|
.request_fields ⇒ Object
26
27
28
|
# File 'lib/credit_check.rb', line 26
def request_fields
[:username, :password]
end
|
.response_fields ⇒ Object
22
23
24
|
# File 'lib/credit_check.rb', line 22
def response_fields
[:status, :limit, :notes]
end
|
Instance Method Details
#get_credit_limit ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/credit_check.rb', line 12
def get_credit_limit
url = self.class.build_url(
:username => @config.username,
:password => @config.password
)
self.class.response_to_hash(ExetelSms::Client.request(url))
end
|