Module: ToApiFilter
- Included in:
- ActiveRecord::Associations::CollectionProxy, ActiveRecord::Base, ActiveRecord::NamedScope::Scope, ActiveRecord::Relation, Array, Hash
- Defined in:
- lib/to_api.rb
Instance Method Summary collapse
- #add_to_api_filter(include_name, &block) ⇒ Object
- #to_api_filters ⇒ Object
- #to_api_filters=(filters) ⇒ Object
Instance Method Details
#add_to_api_filter(include_name, &block) ⇒ Object
36 37 38 39 |
# File 'lib/to_api.rb', line 36 def add_to_api_filter(include_name, &block) @_to_api_filters ||= {} @_to_api_filters[include_name] = block end |
#to_api_filters ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/to_api.rb', line 45 def to_api_filters if frozen? @_to_api_filters || {} else @_to_api_filters ||= {} end end |
#to_api_filters=(filters) ⇒ Object
41 42 43 |
# File 'lib/to_api.rb', line 41 def to_api_filters=(filters) @_to_api_filters = filters end |