Sha256: 9f032ac47121fb3d73a97bc245c01c1c8fde8c07c37712d39b5842e6754da997
Contents?: true
Size: 870 Bytes
Versions: 10
Compression:
Stored size: 870 Bytes
Contents
module Avo class Filter attr_accessor :name attr_accessor :component attr_accessor :default @@default = nil def initialize @name ||= 'Filter' @component ||= 'boolean-filter' @default ||= '' end def render_response { id: id, name: name, options: options, component: component, default: default_value, filter_class: self.class.to_s, } end def apply_query(request, query, value) value.symbolize_keys! if value.is_a? Hash self.apply(request, query, value) end def id self.class.name.underscore.gsub('/', '_') end # These methods helps us set a default value in the testing environment def default_value @@default || default end def self.set_default(value) @@default = value end end end
Version data entries
10 entries across 10 versions & 1 rubygems