Class: JIRA::ServerInfo
- Inherits:
-
Object
- Object
- JIRA::ServerInfo
- Defined in:
- lib/jiraSOAP/remoteEntities.rb
Overview
TODO:
turn attributes back to read-only by not using a factory for init
Only contains basic information about the endpoint server.
Instance Attribute Summary collapse
- #base_url ⇒ URL
- #build_date ⇒ Time
- #build_number ⇒ Fixnum
- #edition ⇒ String
- #server_time ⇒ JIRA::TimeInfo
- #version ⇒ String
Class Method Summary collapse
-
.server_info_with_xml_fragment(frag) ⇒ JIRA::ServerInfo?
Factory method that takes a fragment of a SOAP response.
Instance Attribute Details
#base_url ⇒ URL
669 670 671 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 669 def base_url @base_url end |
#build_date ⇒ Time
671 672 673 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 671 def build_date @build_date end |
#build_number ⇒ Fixnum
673 674 675 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 673 def build_number @build_number end |
#edition ⇒ String
675 676 677 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 675 def edition @edition end |
#server_time ⇒ JIRA::TimeInfo
677 678 679 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 677 def server_time @server_time end |
#version ⇒ String
679 680 681 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 679 def version @version end |
Class Method Details
.server_info_with_xml_fragment(frag) ⇒ JIRA::ServerInfo?
Factory method that takes a fragment of a SOAP response.
684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 684 def self.server_info_with_xml_fragment(frag) return if frag.nil? server_info = ServerInfo.new server_info.build_number = frag.xpath('buildNumber').to_s.to_i server_info.edition = frag.xpath('edition').to_s server_info.version = frag.xpath('version').to_s date = frag.xpath('buildDate').to_s server_info.build_date = Time.xmlschema date unless date.nil? server_info.server_time = TimeInfo.time_info_with_xml_fragment frag.xpath 'serverTime' url = frag.xpath('baseUrl').to_s server_info.base_url = URL.new url unless url.nil? server_info end |