Skip to content

Instantly share code, notes, and snippets.

/example.rb Secret

Created April 30, 2016 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/34b9b3fc0db5f0a08224b58707eaeb87 to your computer and use it in GitHub Desktop.
Save anonymous/34b9b3fc0db5f0a08224b58707eaeb87 to your computer and use it in GitHub Desktop.
Trying some meta programming, and I'm doing something wrong with .send
def self.sample_colors
my_colors = colors
# my_colors.each_pair { |k, v| puts "This is " + "\e[#{v}m" + "#{k}" + "\e[0m" }
my_colors.each_key { |k| send('k', "This is #{k}.") }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment