Class: Neuro::Display::ObservableNetwork

Inherits:
Object
  • Object
show all
Includes:
Observable
Defined in:
lib/neuro/display.rb

Instance Method Summary collapse

Methods included from Observable

#add_listener, #notify

Constructor Details

#initialize(neuron) ⇒ ObservableNetwork

Returns a new instance of ObservableNetwork.



325
326
327
# File 'lib/neuro/display.rb', line 325

def initialize(neuron)
  @neuron = neuron
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *a, &b) ⇒ Object



329
330
331
332
333
334
335
336
337
338
339
# File 'lib/neuro/display.rb', line 329

def method_missing(m, *a, &b)
  r = nil
  case m
  when :learn, :decide
    r = @neuron.__send__(m, *a, &b)
    notify m, r, a
  else
    r = @neuron.__send__(m, *a, &b)
  end
  r
end