Class: Smyte::Util
- Inherits:
-
Object
- Object
- Smyte::Util
- Defined in:
- lib/smyte/util.rb
Class Method Summary collapse
Class Method Details
.label_interesting?(name, options) ⇒ Boolean
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/smyte/util.rb', line 4 def label_interesting?(name, ) return true unless return true unless [:labels] return true if [:labels].empty? pieces = name.split(":") [:labels].each do |check| if check.is_a?(String) return true if name == check return true if pieces.last == check elsif check.is_a?(Regexp) return true if name =~ check return true if pieces.last =~ check end end return false end |