Sha256: 047231c848001c514774ab24c42e7c9fa75daeb4a774d1471ad0876f911d4ffd
Contents?: true
Size: 939 Bytes
Versions: 18
Compression:
Stored size: 939 Bytes
Contents
require 'simple_search_filter/filter_field' module SimpleSearchFilter class FilterData attr_accessor :values def values @values ||= {} @values end def v(name, v_def=nil) name = name.to_s return values[name] if v_exist?(name) v_def end def v_empty?(name) a = values if (a.has_key? name) && (!a[name].nil?) return true end false end def v_exist?(name) values.has_key? name end def set(name, v) values[name.to_s] = v end def set_values(a_values) @values = a_values end def clear @values = {} end #### def method_missing(method_sym, *arguments, &block) # the first argument is a Symbol, so you need to_s it if you want to pattern match name = method_sym.to_s if v_exist?(name) return v(name) else super end end end end
Version data entries
18 entries across 18 versions & 1 rubygems