Class: Handsoap::XmlQueryFront::NokogiriDriver
- Inherits:
-
Object
- Object
- Handsoap::XmlQueryFront::NokogiriDriver
- Defined in:
- lib/jiraSOAP/handsoap_extensions.rb
Overview
TODO:
move these extensions straight to the nokogiri layer
Simple extensions on the existing Handsoap class to make parsing easier.
Instance Method Summary collapse
-
#to_date_string ⇒ Time
Parses non-strict date strings into Time objects.
-
#to_hex_string ⇒ String
This is a bit naive, but should be sufficient for its purpose.
-
#to_object(klass) ⇒ Object
An instance of klass.
-
#to_objects(klass) ⇒ Array
An array of klass objects.
-
#to_ss ⇒ [String]
Returns the node's children to an array of strings.
- #to_url ⇒ URI::HTTP, NSURL
Instance Method Details
#to_date_string ⇒ Time
Parses non-strict date strings into Time objects.
45 46 47 48 49 |
# File 'lib/jiraSOAP/handsoap_extensions.rb', line 45 def to_date_string temp = self.to_s return unless temp Time.new temp end |
#to_hex_string ⇒ String
This is a bit naive, but should be sufficient for its purpose.
53 54 55 56 57 |
# File 'lib/jiraSOAP/handsoap_extensions.rb', line 53 def to_hex_string temp = self.to_s return unless temp temp.match(/#(..)(..)(..)/).captures end |
#to_object(klass) ⇒ Object
Returns an instance of klass.
74 75 76 |
# File 'lib/jiraSOAP/handsoap_extensions.rb', line 74 def to_object klass klass.new_with_xml self end |
#to_objects(klass) ⇒ Array
Returns an array of klass objects.
80 81 82 |
# File 'lib/jiraSOAP/handsoap_extensions.rb', line 80 def to_objects klass children.map { |node| klass.new_with_xml node } end |
#to_ss ⇒ [String]
Returns the node's children to an array of strings.
68 69 70 |
# File 'lib/jiraSOAP/handsoap_extensions.rb', line 68 def to_ss children.map { |val| val.to_s } end |
#to_url ⇒ URI::HTTP, NSURL
60 61 62 63 64 |
# File 'lib/jiraSOAP/handsoap_extensions.rb', line 60 def to_url temp = self.to_s return unless temp JIRA.url_class.send JIRA.url_init_method, temp end |