Skip to content

Instantly share code, notes, and snippets.

@mdaisuke
Created August 7, 2010 04:37
Show Gist options
  • Save mdaisuke/512437 to your computer and use it in GitHub Desktop.
Save mdaisuke/512437 to your computer and use it in GitHub Desktop.
class Sample
attr_accessor :method
def initialize
@method = :get
end
def self.get
new.perform
end
def perform
send("perform_#{method}")
end
private
def perform_get
puts "perform_get is called"
end
end
Sample.get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment