lib/ruby_ext/class.rb in ruby-ext-0.4.1 vs lib/ruby_ext/class.rb in ruby-ext-0.4.2
- old
+ new
@@ -1,11 +1,11 @@
Class.class_eval do
- def name_alias name = nil
+ def alias name = nil
if name
name.must_be.a String
name.must_not_be.blank
- @name_alias = name.to_s
+ @alias = name.to_s
else
- @name_alias || self.name
+ @alias ||= self.name.split('::').last
end
end
end
\ No newline at end of file