Class: Identity::EnrollmentResult
- Inherits:
-
Object
- Object
- Identity::EnrollmentResult
- 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><input id="EnrollParam0" type="password" name="passphrase" /></element>
</form_element>
</enrollment_pretext>
Instance Attribute Summary collapse
-
#form_elements ⇒ Object
Returns the value of attribute form_elements.
-
#name ⇒ Object
Returns the value of attribute name.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(xml) ⇒ EnrollmentResult
constructor
A new instance of EnrollmentResult.
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_elements ⇒ Object
Returns the value of attribute form_elements.
42 43 44 |
# File 'lib/identity.rb', line 42 def form_elements @form_elements end |
#name ⇒ Object
Returns the value of attribute name.
42 43 44 |
# File 'lib/identity.rb', line 42 def name @name end |
#result ⇒ Object
Returns the value of attribute result.
42 43 44 |
# File 'lib/identity.rb', line 42 def result @result end |