Class: Beeps::Processor

Inherits:
Object
  • Object
show all
Includes:
Xot::Hookable, Xot::Setter
Defined in:
lib/beeps/processor.rb

Instance Method Summary collapse

Constructor Details

#initialize(*inputs, **options, &block) ⇒ Processor



17
18
19
20
21
22
# File 'lib/beeps/processor.rb', line 17

def initialize(*inputs, **options, &block)
  super()
  add_input(*inputs)
  set options unless options.empty?
  Xot::BlockUtil.instance_eval_or_block_call self, &block if block
end

Instance Method Details

#>>(processor) ⇒ Object



31
32
33
34
# File 'lib/beeps/processor.rb', line 31

def >>(processor)
  processor.add_input self
  processor
end

#add_input(*inputs) ⇒ Object



26
27
28
29
# File 'lib/beeps/processor.rb', line 26

def add_input(*inputs)
  last       = inputs.flatten.compact.last
  self.input = last if last
end