Class: Listings::CustomFilterDescriptor
- Inherits:
-
Object
- Object
- Listings::CustomFilterDescriptor
- Defined in:
- lib/listings/custom_filter_descriptor.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
-
#props ⇒ Object
readonly
Returns the value of attribute props.
Instance Method Summary collapse
- #apply_filter(value) ⇒ Object
- #build(listing) ⇒ Object
-
#initialize(key, props, proc) ⇒ CustomFilterDescriptor
constructor
A new instance of CustomFilterDescriptor.
Constructor Details
#initialize(key, props, proc) ⇒ CustomFilterDescriptor
Returns a new instance of CustomFilterDescriptor.
7 8 9 10 11 |
# File 'lib/listings/custom_filter_descriptor.rb', line 7 def initialize(key, props, proc) @key = key @props = props @proc = proc end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/listings/custom_filter_descriptor.rb', line 3 def key @key end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
5 6 7 |
# File 'lib/listings/custom_filter_descriptor.rb', line 5 def proc @proc end |
#props ⇒ Object (readonly)
Returns the value of attribute props.
4 5 6 |
# File 'lib/listings/custom_filter_descriptor.rb', line 4 def props @props end |
Instance Method Details
#apply_filter(value) ⇒ Object
17 18 19 |
# File 'lib/listings/custom_filter_descriptor.rb', line 17 def apply_filter(value) data_source.filter(field, value) end |
#build(listing) ⇒ Object
13 14 15 |
# File 'lib/listings/custom_filter_descriptor.rb', line 13 def build(listing) CustomFilterView.new(listing, self) end |