Class: JIRA::CustomField
- Inherits:
-
Object
- Object
- JIRA::CustomField
- Defined in:
- lib/jiraSOAP/remoteEntities.rb
Overview
TODO:
see if @key is always nil from the server
Represents a custom field with values.
Instance Attribute Summary collapse
Class Method Summary collapse
-
.custom_field_with_xml_fragment(frag) ⇒ JIRA::CustomField?
Factory method that takes a fragment of a SOAP response.
Instance Method Summary collapse
-
#soapify_for(msg, label = 'customFieldValues') ⇒ Handsoap::XmlMason::Element
Generate a SOAP message fragment for the object.
Instance Attribute Details
#id ⇒ String
82 83 84 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 82 def id @id end |
#key ⇒ String
84 85 86 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 84 def key @key end |
#values ⇒ [String]
86 87 88 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 86 def values @values end |
Class Method Details
.custom_field_with_xml_fragment(frag) ⇒ JIRA::CustomField?
Factory method that takes a fragment of a SOAP response.
91 92 93 94 95 96 97 98 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 91 def self.custom_field_with_xml_fragment(frag) return if frag.nil? custom_field = CustomField.new custom_field.id = frag.xpath('customfieldId').to_s custom_field.key = frag.xpath('key').to_s custom_field.values = frag.xpath('values/*').map { |value| value.to_s } custom_field end |
Instance Method Details
#soapify_for(msg, label = 'customFieldValues') ⇒ Handsoap::XmlMason::Element
Generate a SOAP message fragment for the object.
104 105 106 107 108 109 110 |
# File 'lib/jiraSOAP/remoteEntities.rb', line 104 def soapify_for(msg, label = 'customFieldValues') msg.add label do |submsg| submsg.add 'customfieldId', @id submsg.add 'key', @key submsg.add_simple_array 'values', @values end end |