Module: MaybeYouMeant::ObjectExtentions
- Defined in:
- lib/maybeyoumeant/object_extensions.rb
Overview
Extends Object to call a method similar to the one called when the method has not been defined on the object.
Defined Under Namespace
Modules: InstanceMethods
Constant Summary collapse
- IGNORE_LIST =
Not 100% sure what the problem is, but if you start mucking about with the following methods in Ruby 1.9 things go horrible wrong, so we just ignore them. They’re likely to be correct anyway.
[ :to_str, :to_int, :to_ary, :to_hash, :to_a ]
Class Method Summary collapse
Class Method Details
.install_instance_methods ⇒ Object
65 66 67 68 |
# File 'lib/maybeyoumeant/object_extensions.rb', line 65 def self.install_instance_methods # Add the instance methods to the base object. Object.send(:include, InstanceMethods) end |
.user_confirmation(nearby) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/maybeyoumeant/object_extensions.rb', line 15 def self.user_confirmation(nearby) Paint["Do you want to call ", :green] + Paint[nearby, :green, :bright] + Paint[" instead?", :green] + " [Y,n]: " end |