Class: Liquid::Drops::ConceptsDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Liquid::Drops::ConceptsDrop
- Defined in:
- lib/liquid/drops/concepts_drop.rb
Constant Summary collapse
- NON_LANGUAGE_FIELDS =
%w[identifier localized_concepts groups term].freeze
Instance Method Summary collapse
- #[](concept_name) ⇒ Object
-
#concepts ⇒ Object
rubocop:enable Lint/MissingSuper.
- #each(&block) ⇒ Object
-
#initialize(managed_concept_collection, filters = {}) ⇒ ConceptsDrop
constructor
rubocop:disable Lint/MissingSuper.
Constructor Details
#initialize(managed_concept_collection, filters = {}) ⇒ ConceptsDrop
rubocop:disable Lint/MissingSuper
9 10 11 12 13 14 15 16 |
# File 'lib/liquid/drops/concepts_drop.rb', line 9 def initialize(managed_concept_collection, filters = {}) @concepts_collection = managed_concept_collection @concepts_map = {} filtered_concepts(@concepts_collection, filters).each do |concept| @concepts_map[concept["term"]] = concept end end |
Instance Method Details
#[](concept_name) ⇒ Object
23 24 25 |
# File 'lib/liquid/drops/concepts_drop.rb', line 23 def [](concept_name) @concepts_map[concept_name] end |
#concepts ⇒ Object
rubocop:enable Lint/MissingSuper
19 20 21 |
# File 'lib/liquid/drops/concepts_drop.rb', line 19 def concepts @concepts_map end |
#each(&block) ⇒ Object
27 28 29 |
# File 'lib/liquid/drops/concepts_drop.rb', line 27 def each(&block) @concepts_map.values.each(&block) end |