lib/formular/element.rb
def process_options
      self.class.processing_hash.each do |key, hash|
        # we can't process if our option is nil
        next if options[key].nil?
        # don't process if our condition is false
        next unless evaluate_option_condition?(hash[:condition])

        # get our value
        val = self.send(hash[:processor], options[key]) # TODO enable procs and blocks

        # set our value
        @options[key] = val
      end
    end
# Options passed into our element instance (@options) take precident over class level defaults
# Take each default value and merge it with options.
# This way ordering is important and we can access values as they are evaluated
Options passed into our element instance (@options) take precident over class level defaults
Take each default value and merge it with options.
This way ordering is important and we can access values as they are evaluated
Options passed into our element instance ( @options ) take precident over class level defaults Take each default value and merge it with options . This way ordering is important and we can access values as they are evaluated
def process_options
      self.class.processing_hash.each do |key, hash|
        next if options[key].nil?
        next unless evaluate_option_condition?(hash[:condition])
        val = self.send(hash[:processor], options[key]) 
        @options[key] = val
      end
    end
def process_options self . class . processing_hash . each do | key , hash | next if options [ key ] . nil? next unless evaluate_option_condition? ( hash [ :condition ] ) val = self . send ( hash [ :processor ] , options [ key ] ) @options [ key ] = val end end
Options passed into our element instance (@options) take precident over class level defaults
Take each default value and merge it with options.
Options passed into our element instance ( @options ) take precident over class level defaults Take each default value and merge it with options .
# we can't process if our option is nil # don't process if our condition is false # get our value # TODO enable procs and blocks # set our value