Skip to content

Commit

Permalink
Modesty#metrics_starting_with allows you to pull the subset of metric…
Browse files Browse the repository at this point in the history
…s beginning with a particular prefix.
  • Loading branch information
Chris Chan committed Jun 26, 2010
1 parent 38b1749 commit 7e2cefd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/modesty/metric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def metrics
end
end

def metrics_starting_with(name)
self.metrics.select{|k, v| k.to_s.starts_with?(name)}
end

def add_metric(metric)
raise Metric::Error, <<-msg if self.metrics.include? metric.slug
Metric #{metric.slug.inspect} already defined!
Expand Down

0 comments on commit 7e2cefd

Please sign in to comment.