Class: Credigy::Login

Inherits:
Request show all
Defined in:
lib/credigy/login.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Request

#basic_config, #call, #client, #config_options, #extra_config_options, #response, #response_class, #wsdl

Constructor Details

#initialize(user:, password:, cpf:) ⇒ Login

Returns a new instance of Login.



8
9
10
# File 'lib/credigy/login.rb', line 8

def initialize(user:, password:, cpf:)
  @user, @password, @cpf = user, password, cpf
end

Instance Attribute Details

#cpfObject (readonly)

Returns the value of attribute cpf.



6
7
8
# File 'lib/credigy/login.rb', line 6

def cpf
  @cpf
end

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'lib/credigy/login.rb', line 6

def password
  @password
end

#userObject (readonly)

Returns the value of attribute user.



6
7
8
# File 'lib/credigy/login.rb', line 6

def user
  @user
end

Instance Method Details

#messageObject



22
23
24
# File 'lib/credigy/login.rb', line 22

def message
  { 'debtorNumber' => cpf }
end

#operationObject



12
13
14
# File 'lib/credigy/login.rb', line 12

def operation
  :login
end

#soap_headerObject



16
17
18
19
20
# File 'lib/credigy/login.rb', line 16

def soap_header
  {
    'cred:AuthenticationLogin' => { 'cred:Username' => user, 'cred:Password' => password }
  }
end