Skip to content

@iain /method_object.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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

DCI huh? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.