Class: Identity::AuthenticationResult
- Inherits:
-
Object
- Object
- Identity::AuthenticationResult
- Defined in:
- lib/identity.rb
Overview
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <authentication_pretext>
<name>guest3f4c5a36a65d46e2</name>
<result xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"authenticationResult\" confidence=\"0.0\" level=\"0\" code=\"0\" message=\"OK\">SUCCESS</result>
<display_item name=\"passphrase\"><display_name>Password</display_name><form_element><input id="AuthParam0" type="password" name="passphrase" class="field required" /></form_element><nickname>Guest Password</nickname></display_item>
</authentication_pretext>
Instance Attribute Summary collapse
-
#display_items ⇒ Object
Returns the value of attribute display_items.
-
#name ⇒ Object
Returns the value of attribute name.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(xml) ⇒ AuthenticationResult
constructor
A new instance of AuthenticationResult.
Constructor Details
#initialize(xml) ⇒ AuthenticationResult
Returns a new instance of AuthenticationResult.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/identity.rb', line 17 def initialize(xml) r = XmlSimple.xml_in(xml, { 'ForceArray' => ['display_item'] }) self.result = r['result'] self.name = r['name'] if result['content'] == 'SUCCESS' || result['content'] == 'CONTINUE' if r['display_item'] && r['display_item'].length > 0 self.display_items = Array.new r['display_item'].each_with_index { |di, index| self.display_items[index] = di } end end end |
Instance Attribute Details
#display_items ⇒ Object
Returns the value of attribute display_items.
15 16 17 |
# File 'lib/identity.rb', line 15 def display_items @display_items end |
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/identity.rb', line 15 def name @name end |
#result ⇒ Object
Returns the value of attribute result.
15 16 17 |
# File 'lib/identity.rb', line 15 def result @result end |