Module: Plumbum::Consumers::InstanceMethods
- Included in:
- Plumbum::Consumer, ScopedConsumer
- Defined in:
- lib/plumbum/consumers/instance_methods.rb
Overview
Instance methods for defining the Consumer interface.
Instance Method Summary collapse
-
#get_plumbum_dependency(key, optional: false) ⇒ Object
Retrieves the dependency with the specified key.
-
#has_plumbum_dependency?(key) ⇒ true, false
Checks if the dependency with the given key is defined.
Instance Method Details
#get_plumbum_dependency(key, optional: false) ⇒ Object
Retrieves the dependency with the specified key.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/plumbum/consumers/instance_methods.rb', line 24 def get_plumbum_dependency(key, optional: false) SleepingKingStudios::Tools::Toolbelt .instance .assertions .validate_name(key, as: :key) find_plumbum_dependency(key) do handle_missing_plumbum_dependency(key, optional:) end end |
#has_plumbum_dependency?(key) ⇒ true, false
Checks if the dependency with the given key is defined.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/plumbum/consumers/instance_methods.rb', line 42 def has_plumbum_dependency?(key) # rubocop:disable Naming/PredicatePrefix SleepingKingStudios::Tools::Toolbelt .instance .assertions .validate_name(key, as: :key) find_plumbum_dependency(key) { return false } true end |