Class: PaginationSearch::AttributeSet
- Inherits:
-
Object
- Object
- PaginationSearch::AttributeSet
- Defined in:
- lib/pagination_search/attribute_set.rb
Defined Under Namespace
Classes: Attribute
Instance Method Summary collapse
- #[](name) ⇒ Object
- #foreign_attributes ⇒ Object
-
#initialize(base_class, attribute_locations) ⇒ AttributeSet
constructor
A new instance of AttributeSet.
- #text_attributes ⇒ Object
Constructor Details
#initialize(base_class, attribute_locations) ⇒ AttributeSet
Returns a new instance of AttributeSet.
13 14 15 16 17 |
# File 'lib/pagination_search/attribute_set.rb', line 13 def initialize(base_class, attribute_locations) @base_class = base_class @attributes = {} build_attributes(attribute_locations) end |
Instance Method Details
#[](name) ⇒ Object
19 20 21 |
# File 'lib/pagination_search/attribute_set.rb', line 19 def [](name) @attributes[name] end |
#foreign_attributes ⇒ Object
23 24 25 26 27 |
# File 'lib/pagination_search/attribute_set.rb', line 23 def foreign_attributes @attributes.values.select do |attribute| foreign?(attribute.association_name) end end |
#text_attributes ⇒ Object
29 30 31 32 33 |
# File 'lib/pagination_search/attribute_set.rb', line 29 def text_attributes @attributes.values.select do |attribute| text?(attribute.type) end end |