Class: EC2::CreateKeyPairResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/EC2/responses.rb

Constant Summary collapse

ELEMENT_XPATH =
"CreateKeyPairResponse"

Constants inherited from Response

Response::ERROR_XPATH

Instance Attribute Summary

Attributes inherited from Response

#http_response, #http_xml, #structure

Instance Method Summary collapse

Methods inherited from Response

#initialize, #is_error?, #parse_error, #to_s

Constructor Details

This class inherits a constructor from EC2::Response

Instance Method Details

#parseObject



96
97
98
99
100
101
102
103
104
105
# File 'lib/EC2/responses.rb', line 96

def parse
  doc = REXML::Document.new(@http_xml)
  element = REXML::XPath.first(doc, ELEMENT_XPATH)
  
  keyName = REXML::XPath.first(element, "keyName").text
  keyFingerprint = REXML::XPath.first(element, "keyFingerprint").text
  keyMaterial = REXML::XPath.first(element, "keyMaterial").text
  
  line = [["KEYPAIR", keyName, keyFingerprint], [keyMaterial]]
end