Class: Yardi::RequestSection::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/yardi/request_section/authentication.rb

Overview

Generate the auth section of a Yardi request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credential) ⇒ Authentication

Returns a new instance of Authentication.



9
10
11
# File 'lib/yardi/request_section/authentication.rb', line 9

def initialize(credential)
  @credential = credential
end

Instance Attribute Details

#credentialObject (readonly)

Returns the value of attribute credential.



7
8
9
# File 'lib/yardi/request_section/authentication.rb', line 7

def credential
  @credential
end

Instance Method Details

#generate(xml_builder) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/yardi/request_section/authentication.rb', line 13

def generate(xml_builder)
  xml_builder['itf'].UserName credential.username
  xml_builder['itf'].Password credential.password
  xml_builder['itf'].ServerName credential.server
  xml_builder['itf'].Database credential.database
  xml_builder['itf'].Platform Yardi.config.platform
  xml_builder['itf'].InterfaceEntity Yardi.config.entity
  xml_builder['itf'].InterfaceLicense Yardi.config.license_key
end