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