Class: JIRA::ServerInfo

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Attribute Details

#base_urlURL

Returns:



669
670
671
# File 'lib/jiraSOAP/remoteEntities.rb', line 669

def base_url
  @base_url
end

#build_dateTime

Returns:

  • (Time)


671
672
673
# File 'lib/jiraSOAP/remoteEntities.rb', line 671

def build_date
  @build_date
end

#build_numberFixnum

Returns:

  • (Fixnum)


673
674
675
# File 'lib/jiraSOAP/remoteEntities.rb', line 673

def build_number
  @build_number
end

#editionString

Returns:

  • (String)


675
676
677
# File 'lib/jiraSOAP/remoteEntities.rb', line 675

def edition
  @edition
end

#server_timeJIRA::TimeInfo

Returns:



677
678
679
# File 'lib/jiraSOAP/remoteEntities.rb', line 677

def server_time
  @server_time
end

#versionString

Returns:

  • (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.

Parameters:

  • frag (Handsoap::XmlQueryFront::NokogiriDriver)

Returns:



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