Class: Medicine::Dependencies Private
- Inherits:
-
Object
- Object
- Medicine::Dependencies
- Includes:
- Enumerable
- Defined in:
- lib/medicine/dependencies.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #<<(dependency) ⇒ Object private
- #[](name) ⇒ Object private
- #add(name, options = {}) ⇒ Object private
- #all ⇒ Object private
- #each(&block) ⇒ Object private
- #empty? ⇒ Boolean private
- #fetch(name) ⇒ Object private
- #include?(name) ⇒ Boolean private
-
#initialize ⇒ Dependencies
constructor
private
A new instance of Dependencies.
- #push(dependency) ⇒ Object private
- #size ⇒ Object private
- #without_default ⇒ Object private
Constructor Details
#initialize ⇒ Dependencies
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Dependencies.
12 13 14 |
# File 'lib/medicine/dependencies.rb', line 12 def initialize @dependencies = [] end |
Instance Method Details
#<<(dependency) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 |
# File 'lib/medicine/dependencies.rb', line 44 def <<(dependency) push(dependency) end |
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'lib/medicine/dependencies.rb', line 32 def [](name) find { |dependency| dependency.name == name } end |
#add(name, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 |
# File 'lib/medicine/dependencies.rb', line 48 def add(name, = {}) push(Dependency.new(name, )) end |
#all ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/medicine/dependencies.rb', line 16 def all @dependencies end |
#each(&block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/medicine/dependencies.rb', line 20 def each(&block) all.each(&block) end |
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/medicine/dependencies.rb', line 24 def empty? all.empty? end |
#fetch(name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
36 37 38 |
# File 'lib/medicine/dependencies.rb', line 36 def fetch(name) self[name] || raise(UnknownDependency, "Dependency #{name} is unknown") end |
#include?(name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/medicine/dependencies.rb', line 40 def include?(name) !!self[name] end |
#push(dependency) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 |
# File 'lib/medicine/dependencies.rb', line 52 def push(dependency) all.push(dependency) end |
#size ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/medicine/dependencies.rb', line 28 def size all.size end |
#without_default ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 |
# File 'lib/medicine/dependencies.rb', line 56 def without_default reject(&:default?) end |