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 |
# File 'lib/liquid/drops/concepts_drop.rb', line 9 def initialize(managed_concept_collection, filters = {}) @concepts_collection = managed_concept_collection @concepts = filtered_concepts(@concepts_collection, filters) end |
Instance Method Details
#[](concept_name) ⇒ Object
19 20 21 |
# File 'lib/liquid/drops/concepts_drop.rb', line 19 def [](concept_name) @concepts.find { |c| c["term"] == concept_name } end |
#concepts ⇒ Object
rubocop:enable Lint/MissingSuper
15 16 17 |
# File 'lib/liquid/drops/concepts_drop.rb', line 15 def concepts @concepts end |
#each(&block) ⇒ Object
23 24 25 |
# File 'lib/liquid/drops/concepts_drop.rb', line 23 def each(&block) @concepts.each(&block) end |