Skip to content

Instantly share code, notes, and snippets.

@beerlington
Created January 13, 2011 20:38
Show Gist options
  • Save beerlington/778546 to your computer and use it in GitHub Desktop.
Save beerlington/778546 to your computer and use it in GitHub Desktop.
Constant.find_all_by_global(true).each do |c|
@system_constants.class_eval do
define_method c.name.fieldize, lambda { detect {|sc| sc.constant.name == c.name}.instance_eval { {:value => value, :unit => c.unit} } }
end
end unless @system_constants.empty?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment