lib/danica/operator/chained.rb in danica-2.6.4 vs lib/danica/operator/chained.rb in danica-2.7.1
- old
+ new
@@ -12,12 +12,12 @@
def include?(value)
value = wrap_value(value)
variables.include?(value.content)
end
- def to(format)
- extractor = string_extractor(format)
+ def to(format, **options)
+ extractor = string_extractor(format, **options)
variables.procedural_join(extractor, &join_proc(symbol(format)))
end
def variables
@variables.map(&:content)
@@ -36,13 +36,13 @@
def join_proc(symbol)
proc { " #{symbol} " }
end
- def string_extractor(method)
+ def string_extractor(*args)
proc do |parcel|
parcel = wrap_as_group(parcel)
- parcel.to(method)
+ parcel.to(*args)
end
end
def repack(other)
other_variables = other.is_a?(self.class) ? other.variables : [ other ]