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

Instance Method Summary collapse

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



10
11
12
# File 'lib/confirmation_code.rb', line 10

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



10
11
12
# File 'lib/confirmation_code.rb', line 10

def username
  @username
end

Instance Method Details

#accountObject



29
30
31
# File 'lib/confirmation_code.rb', line 29

def 
  @service. default_options 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, default_options 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, options = {})
  options = default_options.merge options
  if image_path.start_with?('http')
    @service.upload image_path, options if @service
  else
    @service.upload_local image_path, options 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, options = {})
  @service = ConfirmationCode::Service.const_get("#{service.to_s.capitalize}")
  @service.set_extra_options(options)
  @username = username
  @password = password
  @service
end