Class: YPetri::Agent::Selection

Inherits:
Object
  • Object
show all
Defined in:
lib/y_petri/agent/selection.rb

Instance Method Summary collapse

Constructor Details

#initializeSelection

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

#clearObject



7
# File 'lib/y_petri/agent/selection.rb', line 7

def clear; @selection = [] end

#getObject



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