Class: Identity::EnrollmentResult

Inherits:
Object
  • Object
show all
Defined in:
lib/identity.rb

Overview

<?xml version=“1.0” encoding=“UTF-8” standalone=“yes”?> <enrollment_pretext>

<name>test</name>
<result code="0" message="OK">SUCCESS</result>
<form_element display_name="Password" name="passphrase">
  <element>&lt;input id=&quot;EnrollParam0&quot; type=&quot;password&quot; name=&quot;passphrase&quot; /&gt;</element>
</form_element>

</enrollment_pretext>

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ EnrollmentResult

Returns a new instance of EnrollmentResult.



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/identity.rb', line 44

def initialize(xml)
  r = XmlSimple.xml_in(xml, { 'ForceArray' => ['form_element'] })
  self.name = r['name']
  self.result = r['result']
  if self.result['content'] == 'SUCCESS'
    if r['form_elements'] && r['form_elements'].length > 0
      self.form_elements = Array.new
      r['form_elements'].each_with_index { |fe, index| self.form_elements[index] = fe }
    end
  end
end

Instance Attribute Details

#form_elementsObject

Returns the value of attribute form_elements.



42
43
44
# File 'lib/identity.rb', line 42

def form_elements
  @form_elements
end

#nameObject

Returns the value of attribute name.



42
43
44
# File 'lib/identity.rb', line 42

def name
  @name
end

#resultObject

Returns the value of attribute result.



42
43
44
# File 'lib/identity.rb', line 42

def result
  @result
end