Class: Mayu::Resources::DependencyGraph::Node
- Inherits:
-
Object
- Object
- Mayu::Resources::DependencyGraph::Node
- Extended by:
- T::Sig
- Defined in:
- lib/mayu/resources/dependency_graph.rb
Constant Summary collapse
- MarshalFormat =
T.type_alias { [Resource, T::Set[String], T::Set[String]] }
Instance Attribute Summary collapse
-
#incoming ⇒ Object
readonly
Returns the value of attribute incoming.
-
#outgoing ⇒ Object
readonly
Returns the value of attribute outgoing.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #delete(id) ⇒ Object
-
#initialize(resource) ⇒ Node
constructor
A new instance of Node.
- #marshal_dump ⇒ Object
- #marshal_load(dumped) ⇒ Object
Constructor Details
#initialize(resource) ⇒ Node
Returns a new instance of Node.
35 36 37 38 39 |
# File 'lib/mayu/resources/dependency_graph.rb', line 35 def initialize(resource) @resource = resource @incoming = T.let(Set.new, T::Set[String]) @outgoing = T.let(Set.new, T::Set[String]) end |
Instance Attribute Details
#incoming ⇒ Object (readonly)
Returns the value of attribute incoming.
30 31 32 |
# File 'lib/mayu/resources/dependency_graph.rb', line 30 def incoming @incoming end |
#outgoing ⇒ Object (readonly)
Returns the value of attribute outgoing.
32 33 34 |
# File 'lib/mayu/resources/dependency_graph.rb', line 32 def outgoing @outgoing end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
28 29 30 |
# File 'lib/mayu/resources/dependency_graph.rb', line 28 def resource @resource end |
Instance Method Details
#delete(id) ⇒ Object
42 43 44 45 |
# File 'lib/mayu/resources/dependency_graph.rb', line 42 def delete(id) @incoming.delete(id) @outgoing.delete(id) end |
#marshal_dump ⇒ Object
51 52 53 |
# File 'lib/mayu/resources/dependency_graph.rb', line 51 def marshal_dump [@resource, @incoming, @outgoing] end |
#marshal_load(dumped) ⇒ Object
56 57 58 |
# File 'lib/mayu/resources/dependency_graph.rb', line 56 def marshal_load(dumped) @resource, @incoming, @outgoing = dumped end |