Class: Solanum::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/solanum/matcher.rb

Overview

A matcher takes in an input string and returns a hash of measurement names to numeric values.

Author

Greg Look

Direct Known Subclasses

JSONReader, LinePattern

Defined Under Namespace

Classes: JSONReader, LinePattern

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fn) ⇒ Matcher

Creates a new Matcher which will run the given function on input.



11
12
13
14
# File 'lib/solanum/matcher.rb', line 11

def initialize(fn)
  raise "function must be provided" if fn.nil?
  @fn = fn
end

Instance Attribute Details

#fnObject (readonly)

Returns the value of attribute fn.



8
9
10
# File 'lib/solanum/matcher.rb', line 8

def fn
  @fn
end

Instance Method Details

#call(input) ⇒ Object

Attempts to match the given input, returning a hash of metrics.



17
18
19
# File 'lib/solanum/matcher.rb', line 17

def call(input)
  {}
end