lib/clowne/cloner.rb in clowne-1.2.0 vs lib/clowne/cloner.rb in clowne-1.3.0

- old
+ new

@@ -42,11 +42,11 @@ @traits[name] ||= Declarations::Trait.new @traits[name].extend_with(block) end # rubocop: disable Metrics/AbcSize, Metrics/MethodLength - def call(object, **options) + def call(object, **options, &block) raise(UnprocessableSourceError, "Nil is not cloneable object") if object.nil? options = Clowne::Utils::Options.new(options) current_adapter = current_adapter(options.adapter) @@ -57,10 +57,10 @@ default_plan(current_adapter: current_adapter) else plan_with_traits(options.traits, current_adapter: current_adapter) end - plan = Clowne::Planner.enhance(plan, Proc.new) if block_given? + plan = Clowne::Planner.enhance(plan, block) if block plan = Clowne::Planner.filter_declarations(plan, options.only) call_operation(current_adapter, object, plan, options) end