Class: Pact::MatchingRules::Extract

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/matching_rules/extract.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(matchable) ⇒ Extract

Returns a new instance of Extract.



9
10
11
12
# File 'lib/pact/matching_rules/extract.rb', line 9

def initialize matchable
  @matchable = matchable
  @rules = Hash.new
end

Class Method Details

.call(matchable) ⇒ Object



5
6
7
# File 'lib/pact/matching_rules/extract.rb', line 5

def self.call matchable
  new(matchable).call
end

Instance Method Details

#callObject



14
15
16
17
# File 'lib/pact/matching_rules/extract.rb', line 14

def call
  recurse matchable, "$", nil
  rules
end