Method: Daru::Vector#method_missing

Defined in:
lib/daru/vector.rb

#method_missing(name, *args, &block) ⇒ Object



1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
# File 'lib/daru/vector.rb', line 1466

def method_missing(name, *args, &block)
  # FIXME: it is shamefully fragile. Should be either made stronger
  # (string/symbol dychotomy, informative errors) or removed totally. - zverok
  if name =~ /(.+)\=/
    self[$1.to_sym] = args[0]
  elsif has_index?(name)
    self[name]
  else
    super
  end
end