Class: XLFormRowDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/ProMotion/XLForm/xl_form_patch.rb

Instance Method Summary collapse

Instance Method Details

#copyWithZone(zone) ⇒ Object



22
23
24
25
26
27
# File 'lib/ProMotion/XLForm/xl_form_patch.rb', line 22

def copyWithZone(zone)
  row_descriptor_copy = old_copyWithZone(zone)

  row_descriptor_copy.valueTransformer = self.valueTransformer
  row_descriptor_copy
end

#old_copyWithZone ⇒ Object



20
# File 'lib/ProMotion/XLForm/xl_form_patch.rb', line 20

alias :old_copyWithZone :copyWithZone

#options=(options) ⇒ Object



29
30
31
# File 'lib/ProMotion/XLForm/xl_form_patch.rb', line 29

def options=(options)
  self.selectorOptions = parse_options(options)
end

#parse_options(options) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/ProMotion/XLForm/xl_form_patch.rb', line 33

def parse_options(options)
  return nil if options.nil? or options.empty?

  options.map do |key, text|
    val = key
    if val.is_a? Symbol
      val = val.to_s
    end
    XLFormOptionsObject.formOptionsObjectWithValue(val, displayText: text)
  end
end