Class: Pvectl::Selectors::Container
- Defined in:
- lib/pvectl/selectors/container.rb
Overview
Selector for filtering containers.
Extends Base with container-specific field extraction. Supports: status, tags, pool, name, template.
Constant Summary collapse
- SUPPORTED_FIELDS =
%w[status tags pool name template].freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#apply(containers) ⇒ Array<Models::Container>
Applies selector to container collection.
Methods inherited from Base
#empty?, #initialize, #matches?, parse, parse_all
Constructor Details
This class inherits a constructor from Pvectl::Selectors::Base
Instance Method Details
#apply(containers) ⇒ Array<Models::Container>
Applies selector to container collection.
29 30 31 32 33 |
# File 'lib/pvectl/selectors/container.rb', line 29 def apply(containers) return containers if empty? containers.select { |ct| matches?(ct) } end |