Module: ConfirmationCode
- Extended by:
- ConfirmationCode
- Included in:
- ConfirmationCode, Service::Damatu, Service::Lianzhong
- Defined in:
- lib/confirmation_code.rb,
lib/confirmation_code/version.rb,
lib/confirmation_code/service/damatu.rb,
lib/confirmation_code/service/lianzhong.rb
Defined Under Namespace
Modules: Service
Constant Summary collapse
- VERSION =
"0.0.7"
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
- #account ⇒ Object
- #recognition_error(yzm_id) ⇒ Object
- #upload(image_path, options = {}) ⇒ Object
- #use(service, username, password, options = {}) ⇒ Object
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
10 11 12 |
# File 'lib/confirmation_code.rb', line 10 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
10 11 12 |
# File 'lib/confirmation_code.rb', line 10 def username @username end |
Instance Method Details
#account ⇒ Object
29 30 31 |
# File 'lib/confirmation_code.rb', line 29 def account @service.account if @service end |
#recognition_error(yzm_id) ⇒ Object
33 34 35 |
# File 'lib/confirmation_code.rb', line 33 def recognition_error(yzm_id) @service.recognition_error yzm_id, if @service end |
#upload(image_path, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/confirmation_code.rb', line 20 def upload(image_path, = {}) = .merge if image_path.start_with?('http') @service.upload image_path, if @service else @service.upload_local image_path, if @service end end |
#use(service, username, password, options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/confirmation_code.rb', line 12 def use(service, username, password, = {}) @service = ConfirmationCode::Service.const_get("#{service.to_s.capitalize}") @service.() @username = username @password = password @service end |