lib/core/facets/metaid.rb in facets-2.4.5 vs lib/core/facets/metaid.rb in facets-2.5.0
- old
+ new
@@ -4,22 +4,22 @@
#
# def X.y?; "y?" ; end
# X.meta_alias "ynot?", "y?"
# X.ynot? #=> y?
#
- # CREDIT: Trans
+ # CREDIT: Trans
def meta_alias(*args)
meta_class do
alias_method(*args)
end
end
# Evaluate code in a metaclass. This is equivalent to
# 'meta_class.instance_eval'.
#
- # CREDIT: WhyTheLuckyStiff
+ # CREDIT: WhyTheLuckyStiff
def meta_eval(str=nil, &blk)
if str
meta_class.instance_eval(str)
else
@@ -31,11 +31,11 @@
#
# class X; end
# X.meta_def(:x){"x"}
# X.x #=> "x"
#
- # CREDIT: WhyTheLuckyStiff
+ # CREDIT: WhyTheLuckyStiff
def meta_def( name, &block )
meta_class do
define_method( name, &block )
end
@@ -62,11 +62,11 @@
# unclasped and bearing north toward chilled shrimp.
# I know what my Hallowe’en pumpkin is going to say.
#
# -- why the lucky stiff
#
- # CREDIT: WhyTheLuckyStiff
+ # CREDIT: WhyTheLuckyStiff
def eigenclass
(class << self; self; end)
end
@@ -75,10 +75,10 @@
class Module
# Defines an instance method within a class.
#
- # CREDIT: WhyTheLuckyStiff
+ # CREDIT: WhyTheLuckyStiff
def class_def name, &blk
class_eval { define_method name, &blk }
end