Module: Looksee::ObjectMixin
- Defined in:
- lib/looksee/core_ext.rb
Class Method Summary collapse
-
.rename(name) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#look(*args) ⇒ Object
Shortcut for Looksee[self, *args].
Class Method Details
.rename(name) ⇒ Object
:nodoc:
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/looksee/core_ext.rb', line 10 def self.rename(name) # :nodoc: if name.is_a?(Hash) warning = "You have renamed Looksee's method with Looksee.rename(#{name.inspect}).\n\n" + "Looksee now uses #look instead of #ls." if name[:ls].to_s == 'look' warn warning << " You can remove this customization." elsif name[:ls] warn warning << " Please rename with Looksee.rename(#{name[:ls].inspect}), or remove this customization." end elsif name.to_s == 'look' warn warning << " You can remove this customization." end name = name[:look] || name[:ls] if name.is_a?(Hash) alias_method name, :look remove_method :look end |
Instance Method Details
#look(*args) ⇒ Object
Shortcut for Looksee[self, *args].
6 7 8 |
# File 'lib/looksee/core_ext.rb', line 6 def look(*args) Looksee[self, *args] end |