module Sean::Connery

Constants

C_REGEX
ESS_REGEX
S_REGEX
VERSION

Public Class Methods

aliash_the(base, method) click to toggle source
# File lib/sean/connery.rb, line 46
def self.aliash_the(base, method)
  owner = base.method(method).owner
  owner.send :alias_method, self.say(method.to_s).to_sym, method
end
included(base) click to toggle source
# File lib/sean/connery.rb, line 17
def self.included(base)
  base.extend(ClassMethods)
end
say(something) click to toggle source
# File lib/sean/connery.rb, line 29
def self.say(something)
  something
   .gsub(S_REGEX, '\1sh\3')
   .gsub(C_REGEX, '\1sh\2')
   .gsub('x', 'ksh')
   .gsub(ESS_REGEX, '_esh\1')
end
seanify_the(obj) click to toggle source
# File lib/sean/connery.rb, line 37
def self.seanify_the(obj)
  obj.methods.find_all { |m| m.to_s.include?('s') }.each do |method|
    Sean::Connery.aliash_the obj, method
  end
  obj.class.methods.find_all { |m| m.to_s.include?('s') }.each do |method|
    Sean::Connery.aliash_the obj.class, method
  end
end

Public Instance Methods

ping() click to toggle source
Calls superclass method
# File lib/sean/connery.rb, line 10
def ping
  result = super
  undef ping
  puts 'One. ping. only.'
  result
end