Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/aws/templates/utils/dependency/object.rb
Overview
Dependency method stubs
To avoid checking classes directly to filter out dependencies and non-dependencies, we’re monkey-patching Object class with stubs for Dependency class.
TODO: Devise a better approach and remove the extension
Constant Summary collapse
- EMPTY_SET =
Set.new.freeze
Instance Method Summary collapse
-
#as_a_dependency ⇒ Object
mark the object as dependency.
-
#as_a_self_dependency ⇒ Object
mark the object as dependency of itself.
-
#dependencies ⇒ Object
it returns a set containing a single dependency on itself.
-
#dependency? ⇒ Boolean
By default an object is not a dependency.
-
#object ⇒ Object
(also: #not_a_dependency)
It returns self.
-
#root ⇒ Object
Object root.
Instance Method Details
#as_a_dependency ⇒ Object
mark the object as dependency
38 39 40 |
# File 'lib/aws/templates/utils/dependency/object.rb', line 38 def as_a_dependency Aws::Templates::Utils::Dependency.new(object) end |
#as_a_self_dependency ⇒ Object
mark the object as dependency of itself
43 44 45 |
# File 'lib/aws/templates/utils/dependency/object.rb', line 43 def as_a_self_dependency as_a_dependency.to_self end |
#dependencies ⇒ Object
it returns a set containing a single dependency on itself
33 34 35 |
# File 'lib/aws/templates/utils/dependency/object.rb', line 33 def dependencies EMPTY_SET end |
#dependency? ⇒ Boolean
By default an object is not a dependency
15 16 17 |
# File 'lib/aws/templates/utils/dependency/object.rb', line 15 def dependency? false end |
#object ⇒ Object Also known as: not_a_dependency
It returns self
20 21 22 |
# File 'lib/aws/templates/utils/dependency/object.rb', line 20 def object self end |
#root ⇒ Object
Object root
It is used to gracefully process dependencies
28 |
# File 'lib/aws/templates/utils/dependency/object.rb', line 28 def root; end |