Class: Method

Inherits:
Object
  • Object
show all
Defined in:
lib/method_missing/method_extension.rb

Instance Method Summary collapse

Instance Method Details

#*(g) ⇒ Object



5
6
7
# File 'lib/method_missing/method_extension.rb', line 5

def *(g)
  ConsMethod.new(self,g)
end

#/(g) ⇒ Object



9
10
11
# File 'lib/method_missing/method_extension.rb', line 9

def /(g)
  ApMethod.new([self, g])
end

#^(power) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/method_missing/method_extension.rb', line 13

def ^(power)
  if power < 2
    self
  else
    ConsMethod.new(self, self ^ (power-1))
  end
end