Module: ChinaSMS
- Extended by:
- ChinaSMS
- Included in:
- ChinaSMS
- Defined in:
- lib/china_sms.rb,
lib/china_sms/version.rb,
lib/china_sms/service/emay.rb,
lib/china_sms/service/tui3.rb,
lib/china_sms/service/smsbao.rb,
lib/china_sms/service/chanyoo.rb,
lib/china_sms/service/yunpian.rb
Defined Under Namespace
Modules: Service
Constant Summary collapse
- VERSION =
"0.0.6"
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #clear ⇒ Object
- #get(options = {}) ⇒ Object
- #to(receiver, content, options = {}) ⇒ Object
- #use(service, options) ⇒ Object
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
11 12 13 |
# File 'lib/china_sms.rb', line 11 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
11 12 13 |
# File 'lib/china_sms.rb', line 11 def username @username end |
Instance Method Details
#clear ⇒ Object
30 31 32 |
# File 'lib/china_sms.rb', line 30 def clear @service = @username = @password = nil end |
#get(options = {}) ⇒ Object
25 26 27 28 |
# File 'lib/china_sms.rb', line 25 def get( = {}) = .merge @service.get if @service end |
#to(receiver, content, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/china_sms.rb', line 20 def to(receiver, content, = {}) = .merge @service.to receiver, content.strip, if @service end |
#use(service, options) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/china_sms.rb', line 13 def use(service, ) @service = ChinaSMS::Service.const_get("#{service.to_s.capitalize}") @service.const_set("URL", [:base_uri]) if [:base_uri] @username = [:username] @password = [:password] end |