Class Core::Model::Support::MultipleChoiceProperty
In: core/model/support.rb
Parent: Property

Methods

new   to_xml  

Attributes

multiple  [RW] 
options  [RW] 

Public Class methods

[Source]

# File core/model/support.rb, line 76
        def initialize(key, name, value, options, multiple)
          new_value = value.instance_of?(String) ? [value] : value
          super(key, name, new_value)
          @options = options
          @multiple = multiple
        end

Public Instance methods

[Source]

# File core/model/support.rb, line 83
        def to_xml(options = {})
          xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
          xml.instruct! unless options[:skip_instruct]
          xml.multiplechoiceproperty { 
            xml.key @key.to_s
            xml.name @name 
            xml.multiple @multiple
            xml.options {
              @options.each { |o| xml.option o }
            }
            xml.values {
              @value.each { |v| xml.value v  }
            }
      
          }
        end

[Validate]