Create a gist now

Instantly share code, notes, and snippets.

Hiding methods
module MethodObject
def call(*args, &block)
new(*args, &block).instance_eval { call }
end
def self.extended(cls)
class << cls
private :new
end
end
end
class PublishesPost
extend MethodObject
private
def initialize(post, user)
# ...
end
def call
# ...
end
end
@txus
txus commented May 3, 2012

DCI huh? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment