Module: IletiMerkezi::Authentication

Defined in:
lib/ileti_merkezi/authentication.rb

Overview

Authentication

Class Method Summary collapse

Class Method Details

.auth_basicObject



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

def auth_basic
  config = IletiMerkezi.configuration
  "  <authentication>\n    <username>\#{config.username}</username>\n    <password>\#{config.password}</password>\n  </authentication>\n  XML\nend\n".gsub(/^[ ]+/, '').strip

.auth_tokenObject



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

def auth_token
  config = IletiMerkezi.configuration
  "  <authentication>\n    <key>\#{config.public_key}</key>\n    <hash>\#{config.hmac}</hash>\n  </authentication>\n  XML\nend\n".gsub(/^[ ]+/, '').strip

.contentObject



8
9
10
# File 'lib/ileti_merkezi/authentication.rb', line 8

def content
  send(IletiMerkezi.configuration.auth_method)
end