Module: PigeonFu::Sms::InstanceMethods
- Defined in:
- lib/pigeon_fu/sms.rb
Instance Attribute Summary collapse
-
#auth ⇒ Object
writeonly
Sets the attribute auth.
-
#content ⇒ Object
writeonly
Sets the attribute content.
-
#receivers ⇒ Object
writeonly
Sets the attribute receivers.
-
#sender ⇒ Object
writeonly
Sets the attribute sender.
Instance Method Summary collapse
Instance Attribute Details
#auth=(value) ⇒ Object (writeonly)
Sets the attribute auth
50 51 52 |
# File 'lib/pigeon_fu/sms.rb', line 50 def auth=(value) @auth = value end |
#content=(value) ⇒ Object (writeonly)
Sets the attribute content
50 51 52 |
# File 'lib/pigeon_fu/sms.rb', line 50 def content=(value) @content = value end |
#receivers=(value) ⇒ Object (writeonly)
Sets the attribute receivers
50 51 52 |
# File 'lib/pigeon_fu/sms.rb', line 50 def receivers=(value) @receivers = value end |
#sender=(value) ⇒ Object (writeonly)
Sets the attribute sender
50 51 52 |
# File 'lib/pigeon_fu/sms.rb', line 50 def sender=(value) @sender = value end |
Instance Method Details
#send_message_to(receiver) ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/pigeon_fu/sms.rb', line 56 def (receiver) auth_token = @auth.run request_vars = {'SendMsgRequest' => [auth_token, receiver, @content, @sender].join("$")} response = PigeonFu::Rest.get(PigeonFu::SMS_INTERFACE_URL, request_vars) response_code = response.split("=")[1] raise SendSMSFailed, response_code unless response_code.to_i == 200 end |
#send_phone_text_message ⇒ Object
52 53 54 |
# File 'lib/pigeon_fu/sms.rb', line 52 def @receivers.each { |receiver| (receiver) } end |