Module: AttrFilters::FiltersMacro

Defined in:
lib/attr_filters/filters_macro.rb

Instance Method Summary collapse

Instance Method Details

#_registered_filtersObject



16
17
18
# File 'lib/attr_filters/filters_macro.rb', line 16

def _registered_filters
  @_registered_filters || {}
end

#filters(*attributes) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/attr_filters/filters_macro.rb', line 5

def filters(*attributes)
  @_registered_filters ||= {}

  attrs, filters = AttrFilters::Utils.extract_options(attributes)

  check_attributes!(attrs)
  check_filters!(filters.keys)

  register_filters(filters, attrs)
end