Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Hiding methods

View method_object.rb
1 2 3 4 5 6 7 8 9 10 11 12 13
module MethodObject
 
def call(*args, &block)
new(*args, &block).instance_eval { call }
end
 
def self.extended(cls)
class << cls
private :new
end
end
 
end
View method_object.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class PublishesPost
 
extend MethodObject
 
private
 
def initialize(post, user)
# ...
end
 
def call
# ...
end
 
end
txus commented

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.