Class: PackAPI::Querying::AttributeFilterFactory

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/pack_api/querying/attribute_filter_factory.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute_map_class) ⇒ AttributeFilterFactory

Returns a new instance of AttributeFilterFactory.



16
17
18
# File 'lib/pack_api/querying/attribute_filter_factory.rb', line 16

def initialize(attribute_map_class)
  @attribute_map_class = attribute_map_class
end

Instance Attribute Details

#attribute_map_classObject (readonly)

Returns the value of attribute attribute_map_class.



14
15
16
# File 'lib/pack_api/querying/attribute_filter_factory.rb', line 14

def attribute_map_class
  @attribute_map_class
end

Class Method Details

.attribute_filter_cacheObject



10
11
12
# File 'lib/pack_api/querying/attribute_filter_factory.rb', line 10

def self.attribute_filter_cache
  @attribute_filter_cache ||= Concurrent::Map.new
end

Instance Method Details

#from_api_typeObject



20
21
22
23
24
# File 'lib/pack_api/querying/attribute_filter_factory.rb', line 20

def from_api_type
  filterable_attributes.each do |attribute_name, attribute_type|
    yield define_filter(attribute_name, attribute_type)
  end
end