Class: GraphAgent::Command
- Inherits:
-
Object
- Object
- GraphAgent::Command
- Defined in:
- lib/graph_agent/types/command.rb
Constant Summary collapse
- PARENT =
:__parent__
Instance Attribute Summary collapse
-
#goto ⇒ Object
readonly
Returns the value of attribute goto.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#resume ⇒ Object
readonly
Returns the value of attribute resume.
-
#update ⇒ Object
readonly
Returns the value of attribute update.
Instance Method Summary collapse
-
#initialize(graph: nil, update: nil, resume: nil, goto: []) ⇒ Command
constructor
A new instance of Command.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(graph: nil, update: nil, resume: nil, goto: []) ⇒ Command
Returns a new instance of Command.
9 10 11 12 13 14 |
# File 'lib/graph_agent/types/command.rb', line 9 def initialize(graph: nil, update: nil, resume: nil, goto: []) @graph = graph @update = update @resume = resume @goto = Array(goto) end |
Instance Attribute Details
#goto ⇒ Object (readonly)
Returns the value of attribute goto.
7 8 9 |
# File 'lib/graph_agent/types/command.rb', line 7 def goto @goto end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
7 8 9 |
# File 'lib/graph_agent/types/command.rb', line 7 def graph @graph end |
#resume ⇒ Object (readonly)
Returns the value of attribute resume.
7 8 9 |
# File 'lib/graph_agent/types/command.rb', line 7 def resume @resume end |
#update ⇒ Object (readonly)
Returns the value of attribute update.
7 8 9 |
# File 'lib/graph_agent/types/command.rb', line 7 def update @update end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
16 17 18 19 20 21 22 23 |
# File 'lib/graph_agent/types/command.rb', line 16 def to_s parts = [] parts << "graph=#{graph.inspect}" if graph parts << "update=#{update.inspect}" if update parts << "resume=#{resume.inspect}" if resume parts << "goto=#{goto.inspect}" unless goto.empty? "Command(#{parts.join(", ")})" end |