Module: IletiMerkezi::Authentication

Includes:
XmlBuilder
Defined in:
lib/ileti_merkezi/utils/authentication.rb

Overview

Authentication

Constant Summary

Constants included from XmlBuilder

XmlBuilder::XML_TAG

Class Method Summary collapse

Methods included from XmlBuilder

#hash_to_xml

Class Method Details

.auth_basicObject



14
15
16
17
18
19
20
# File 'lib/ileti_merkezi/utils/authentication.rb', line 14

def auth_basic
  config = IletiMerkezi.configuration
  {
    username: config.username,
    password: config.password
  }
end

.auth_tokenObject



22
23
24
25
26
27
28
# File 'lib/ileti_merkezi/utils/authentication.rb', line 22

def auth_token
  config = IletiMerkezi.configuration
  {
    key: config.public_key,
    hash: config.hmac
  }
end

.to_hashObject



10
11
12
# File 'lib/ileti_merkezi/utils/authentication.rb', line 10

def to_hash
  send(IletiMerkezi.configuration.auth_method)
end