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.



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

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

Class Method Details

.call(matchable) ⇒ Object



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

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

Instance Method Details

#callObject



18
19
20
21
# File 'lib/pact/matching_rules/extract.rb', line 18

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