handlers/kinetic_submission_update_attribute_v1/handler/vendor/ars-models-0.0.7/lib/ars_models/field.rb
# Internal JAPI representation of the com.kd.ars.models.structure.ArsField object
Internal JAPI representation of the com.kd.ars.models.structure.ArsField object
Internal JAPI representation of the com . kd . ars . models . structure . ArsField object
def build(options={})
      validate_options(options, :required => [:name], :optional => [:datatype, :id, :label, :entrymode, :default_value, :options])
      if options[:options]
        ars_enum_options = []
        options[:options].each_with_index do |option, index|
          ars_enum_options << ArsEnumFieldOption.new((option[:id] || index).to_s, option[:name], option[:label] || option[:name])
        end
        @ars_field = ArsEnumField.new(options[:name], ars_enum_options.to_java(:'com.kd.ars.models.structure.ArsEnumFieldOption'))
      else
        @ars_field = ArsField.new(options[:name], options[:datatype])
      end
      [:id, :label, :entrymode, :default_value].each do |key|
        self.send("#{key}=", options[key]) if options.has_key?(key)
      end
    end
def build ( options = { } ) validate_options ( options , :required => [ :name ] , :optional => [ :datatype , :id , :label , :entrymode , :default_value , :options ] ) if options [ :options ] ars_enum_options = [ ] options [ :options ] . each_with_index do | option , index | ars_enum_options << ArsEnumFieldOption . new ( ( option [ :id ] || index ) . to_s , option [ :name ] , option [ :label ] || option [ :name ] ) end @ars_field = ArsEnumField . new ( options [ :name ] , ars_enum_options . to_java ( :' com.kd.ars.models.structure.ArsEnumFieldOption ' ) ) else @ars_field = ArsField . new ( options [ :name ] , options [ :datatype ] ) end [ :id , :label , :entrymode , :default_value ] . each do | key | self . send ( "#{key}=" , options [ key ] ) if options . has_key? ( key ) end end
Internal JAPI representation of the com.kd.ars.models.structure.ArsField object
Internal JAPI representation of the com . kd . ars . models . structure . ArsField object
# Validate the options # Store a new JAPI ArsField object
options
<not_specific>