Created
June 8, 2010 06:20
-
-
Save kirushik/429678 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -w | |
require "rubygems" | |
require "stringex" | |
module Asciiable | |
def method_missing(method, *args) | |
return self.send(Regexp.last_match(1)).to_s.to_ascii if(method.to_s=~/(.+)_ascii/) | |
super | |
end | |
end | |
class MD | |
include Asciiable | |
def get | |
"Робототехника" | |
end | |
def q | |
nil | |
end | |
end | |
begin | |
md = MD.new | |
puts md.get | |
puts md.get_ascii | |
puts md.send(:q_ascii) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment