Class: Rad::Conveyors

Inherits:
Object show all
Defined in:
lib/rad/conveyors/_require.rb,
lib/rad/conveyors/_conveyors.rb

Defined Under Namespace

Classes: Conveyor, Params, Processor, Workspace

Instance Method Summary collapse

Constructor Details

#initializeConveyors

Returns a new instance of Conveyors.



2
3
4
# File 'lib/rad/conveyors/_conveyors.rb', line 2

def initialize
  @hash = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, &block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/rad/conveyors/_conveyors.rb', line 12

def method_missing m, &block
  if block
    block.call self[m]
  else
    self[m]
  end
end

Instance Method Details

#[](conveyor_name) ⇒ Object



6
7
8
# File 'lib/rad/conveyors/_conveyors.rb', line 6

def [] conveyor_name
  @hash[conveyor_name.to_s] ||= Conveyor.new
end

#sizeObject



10
# File 'lib/rad/conveyors/_conveyors.rb', line 10

def size; @hash.size end