def define_helper(method_name, base_hash)
      # Which kind of wildcards (if any) do we need to support?
      combined = []
      base_hash.each_value do |v|
        combined += v if v.is_a?(Array)
        combined << v if v.is_a?(String)
      end
      key_value = combined.any? { |i| i.is_a?(String) && /<\S+>/ =~ i }
      printf = combined.any? { |i| i.is_a?(String) && /%/ =~ i }

      if key_value && printf
        fail 'Invalid mixture of key-value and printf wildcards ' \
             "in #{method_name}: #{combined}"
      elsif key_value
        define_key_value_helper(method_name, base_hash)
      elsif printf
        arg_count = combined.join.scan(/%/).length
        define_printf_helper(method_name, base_hash, arg_count)
      else
        # simple static token(s)
        define_static_helper(method_name, base_hash)
      end
      @hash[method_name] = true
    end
def define_helper(method_name, base_hash)
      # Which kind of wildcards (if any) do we need to support?
      combined = []
      base_hash.each_value do |v|
        combined += v if v.is_a?(Array)
        combined << v if v.is_a?(String)
      end
      key_value = combined.any? { |i| i.is_a?(String) && /<\S+>/ =~ i }
      printf = combined.any? { |i| i.is_a?(String) && /%/ =~ i }

      if key_value && printf
        fail 'Invalid mixture of key-value and printf wildcards ' \
             "in #{method_name}: #{combined}"
      elsif key_value
        define_key_value_helper(method_name, base_hash)
      elsif printf
        arg_count = combined.join.scan(/%/).length
        define_printf_helper(method_name, base_hash, arg_count)
      else
        # simple static token(s)
        define_static_helper(method_name, base_hash)
      end
      @hash[method_name] = true
    end
Create a helper method for generating the getter/setter values.
 This method will automatically handle wildcard arguments.