Displaying 2 results from an estimated 2 matches for "hook_a".
Did you mean:
hook_
2006 Nov 04
0
traits-0.9.2 - better living through metaprogramming
...ample/m.rb >========>
~ > cat sample/m.rb
require ''traits''
#
# pre and post hooks can be passed a proc or the name of a method, the
arity is
# detected and the proc/method sent either the value, or the name/value
pair
#
class C
HOOK_A = lambda{|value| puts "HOOK_A : #{ value }"}
HOOK_B = lambda{|name, value| puts "HOOK_B : #{ name } = #{ value }"}
def hook_a value
puts "hook_a : #{ value }"
end
def hook_b name, value
puts "hook_b : #{ name } = #{ v...
2006 Nov 04
0
traits-0.10.0
...sample/m.rb >========>
~ > cat sample/m.rb
require ''traits''
#
# pre and post hooks can be passed a proc or the name of a method, the arity is
# detected and the proc/method sent either the value, or the name/value pair
#
class C
HOOK_A = lambda{|value| puts "HOOK_A : #{ value }"}
HOOK_B = lambda{|name, value| puts "HOOK_B : #{ name } = #{ value }"}
def hook_a value
puts "hook_a : #{ value }"
end
def hook_b name, value
puts "hook_b : #{ name } = #{ v...