Class: YPetri::Agent::Selection
- Inherits:
-
Object
- Object
- YPetri::Agent::Selection
- Defined in:
- lib/y_petri/agent/selection.rb
Instance Method Summary collapse
- #add(arg) ⇒ Object (also: #<<)
- #clear ⇒ Object
- #get ⇒ Object
-
#initialize ⇒ Selection
constructor
TODO: This calls for refactor as Array subclass.
- #set(*aa) ⇒ Object
- #subtract(arg) ⇒ Object
Constructor Details
#initialize ⇒ Selection
TODO: This calls for refactor as Array subclass. No time right now…
4 5 6 |
# File 'lib/y_petri/agent/selection.rb', line 4 def initialize clear end |
Instance Method Details
#add(arg) ⇒ Object Also known as: <<
10 |
# File 'lib/y_petri/agent/selection.rb', line 10 def add arg; @selection << arg end |
#clear ⇒ Object
7 |
# File 'lib/y_petri/agent/selection.rb', line 7 def clear; @selection = [] end |
#get ⇒ Object
9 |
# File 'lib/y_petri/agent/selection.rb', line 9 def get; @selection end |
#set(*aa) ⇒ Object
8 |
# File 'lib/y_petri/agent/selection.rb', line 8 def set *aa; @selection = aa end |
#subtract(arg) ⇒ Object
12 |
# File 'lib/y_petri/agent/selection.rb', line 12 def subtract arg; @selection -= arg end |