class Speck::Battery

A `Battery` of `Speck`s is a set of specks which should be executed together, and which interdepend upon other `Speck`s in the battery. `Batteries` are recursive structures; that is, a `Battery` may have sub– `Batteries` for relevant objects.

Attributes

specks[R]
targets[R]

Public Class Methods

new() click to toggle source
# File lib/speck/battery.rb, line 12
def initialize
  @specks = Array.new
  @targets = Hash.new
end

Public Instance Methods

<<(speck) click to toggle source
# File lib/speck/battery.rb, line 17
def << speck
  @specks << speck
  @targets[speck.target] ||= Battery.new
  return self
end
[](object) click to toggle source
# File lib/speck/battery.rb, line 23
def [] object
  return @targets[object]
end