Class: Quincunx::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/quincunx/builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(args, matchers) ⇒ Builder

Returns a new instance of Builder.



5
6
7
8
# File 'lib/quincunx/builder.rb', line 5

def initialize(args, matchers)
  @args = args
  @matchers = matchers
end

Instance Method Details

#paramsObject



10
11
12
13
14
# File 'lib/quincunx/builder.rb', line 10

def params
  args.zip(extractors).reduce({}) do |acc, (v, extractor)|
    acc.merge(Extractor.new(extractor, v).extract)
  end
end