Class: ExetelSms::Retriever
- Inherits:
-
Object
- Object
- ExetelSms::Retriever
show all
- Extended by:
- ClassMethods
- Defined in:
- lib/retriever.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
#initialize(config) ⇒ Retriever
Returns a new instance of Retriever.
8
9
10
|
# File 'lib/retriever.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/retriever.rb', line 7
def config
@config
end
|
Class Method Details
.api_path ⇒ Object
32
33
34
|
# File 'lib/retriever.rb', line 32
def api_path
'api_sms_detail.php'
end
|
.request_fields ⇒ Object
28
29
30
|
# File 'lib/retriever.rb', line 28
def request_fields
[:username, :password, :referencenumber]
end
|
.response_fields ⇒ Object
24
25
26
|
# File 'lib/retriever.rb', line 24
def response_fields
[:status, :exetel_id, :reference_number, :sender, :to_mobile_number, :received_at, :message_status, :charge, :notes]
end
|
Instance Method Details
#check_sent(reference_number) ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/retriever.rb', line 12
def check_sent(reference_number)
url = self.class.build_url(
:username => @config.username,
:password => @config.password,
:referencenumber => reference_number
)
self.class.response_to_hash(ExetelSms::Client.request(url))
end
|