Module: BrasilfoneAPI
- Defined in:
- lib/brasilfone_api.rb,
lib/brasilfone_api/version.rb,
lib/brasilfone_api/phone_parser.rb,
lib/brasilfone_api/configuration.rb,
lib/brasilfone_api/http_api_handler.rb,
lib/brasilfone_api/http_api_handler/service_uri.rb,
lib/brasilfone_api/http_api_handler/uri_constants.rb
Defined Under Namespace
Modules: HttpAPIHandler
Classes: Configuration, PhoneParser
Constant Summary
collapse
- VERSION =
"0.1.1"
Class Method Summary
collapse
Class Method Details
.balance ⇒ Object
32
33
34
|
# File 'lib/brasilfone_api.rb', line 32
def balance
HttpAPIHandler.send_request_for_service(:GET_BALANCE)
end
|
.config ⇒ Object
12
13
14
|
# File 'lib/brasilfone_api.rb', line 12
def config
BrasilfoneAPI::Configuration.config
end
|
8
9
10
|
# File 'lib/brasilfone_api.rb', line 8
def configure(&block)
BrasilfoneAPI::Configuration.configure(&block)
end
|
.reply_status_for_sms(sms_id) ⇒ Object
44
45
46
47
48
49
|
# File 'lib/brasilfone_api.rb', line 44
def reply_status_for_sms(sms_id)
HttpAPIHandler.send_request_for_service(
:GET_SMS_STATUS,
id: sms_id
)
end
|
.send_sms(destination, text) ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'lib/brasilfone_api.rb', line 16
def send_sms(destination, text)
parsed_phone = BrasilfoneAPI::PhoneParser.parse_phone_number(destination)
HttpAPIHandler.send_request_for_service(
:SEND_SMS,
destination: parsed_phone,
text: text
)
end
|
.sms_status(sms_id) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/brasilfone_api.rb', line 25
def sms_status(sms_id)
HttpAPIHandler.send_request_for_service(
:GET_SMS_STATUS,
id: sms_id
)
end
|
.sms_status_by_date_range(start_date, end_date) ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/brasilfone_api.rb', line 36
def sms_status_by_date_range(start_date, end_date)
HttpAPIHandler.send_request_for_service(
:GET_STATUS_BY_DATE,
start_date: start_date,
end_date: end_date
)
end
|