Class: YeSQL::Bindings::Extractor
- Inherits:
-
Object
- Object
- YeSQL::Bindings::Extractor
- Defined in:
- lib/yesql/bindings/extractor.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(bindings: {}) ⇒ Extractor
constructor
A new instance of Extractor.
Constructor Details
#initialize(bindings: {}) ⇒ Extractor
Returns a new instance of Extractor.
8 9 10 11 |
# File 'lib/yesql/bindings/extractor.rb', line 8 def initialize(bindings: {}) @bindings = bindings @indexed_bindings = bindings.to_a end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/yesql/bindings/extractor.rb', line 13 def call bindings .each_with_object({}) .with_index(1) do |((key, value), hash), index| hash[key] = binding_extracts(hash, indexed_bindings, index, key, value) end end |