Skip to content

Instantly share code, notes, and snippets.

@michiels
Created August 21, 2013 19:13
Show Gist options
  • Save michiels/6298880 to your computer and use it in GitHub Desktop.
Save michiels/6298880 to your computer and use it in GitHub Desktop.
class Metric
attr_accessor :reason
end
class MetricsLoader
def self.load
file = File.open(Rails.root.join('app','metrics.rb'), 'r')
contents = file.read
eval(contents)
end
private
def self.metric(name)
m = Metric.new
yield(m)
puts m.reason
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment