Class: SmsGateway::Base
- Inherits:
-
Object
- Object
- SmsGateway::Base
- Defined in:
- lib/sms_gateway/base.rb,
lib/sms_gateway/adapters/test.rb
Class Attribute Summary collapse
-
.adapter ⇒ Object
Returns the value of attribute adapter.
-
.deliveries ⇒ Object
Returns the value of attribute deliveries.
-
.from ⇒ Object
Returns the value of attribute from.
-
.key ⇒ Object
Returns the value of attribute key.
-
.password ⇒ Object
Returns the value of attribute password.
-
.route ⇒ Object
Returns the value of attribute route.
-
.user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
- .config ⇒ Object
- .config=(options) ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .deliver(sms) ⇒ Object
- .deliver_later(text, to, from = Base.config[:from]) ⇒ Object
Class Attribute Details
.adapter ⇒ Object
Returns the value of attribute adapter.
7 8 9 |
# File 'lib/sms_gateway/base.rb', line 7 def adapter @adapter end |
.deliveries ⇒ Object
Returns the value of attribute deliveries.
7 8 9 |
# File 'lib/sms_gateway/adapters/test.rb', line 7 def deliveries @deliveries end |
.from ⇒ Object
Returns the value of attribute from.
6 7 8 |
# File 'lib/sms_gateway/base.rb', line 6 def from @from end |
.key ⇒ Object
Returns the value of attribute key.
6 7 8 |
# File 'lib/sms_gateway/base.rb', line 6 def key @key end |
.password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/sms_gateway/base.rb', line 6 def password @password end |
.route ⇒ Object
Returns the value of attribute route.
6 7 8 |
# File 'lib/sms_gateway/base.rb', line 6 def route @route end |
.user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/sms_gateway/base.rb', line 6 def user @user end |
Class Method Details
.config ⇒ Object
19 20 21 |
# File 'lib/sms_gateway/base.rb', line 19 def config @config end |
.config=(options) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/sms_gateway/base.rb', line 23 def config=() @config = adapter = @config.delete(:adapter) @config.each do |k,v| self.send "#{k}=", v end self.adapter = adapter end |
.configure {|_self| ... } ⇒ Object
9 10 11 |
# File 'lib/sms_gateway/base.rb', line 9 def configure yield(self) end |
.deliver(sms) ⇒ Object
32 33 34 |
# File 'lib/sms_gateway/base.rb', line 32 def deliver(sms) self.adapter.send_sms(sms) end |
.deliver_later(text, to, from = Base.config[:from]) ⇒ Object
36 37 38 |
# File 'lib/sms_gateway/base.rb', line 36 def self.deliver_later(text, to, from=Base.config[:from]) Resque.enqueue(SmsGateway::Workers::SmsJob, text, to, from) end |