lib/clowne/cloner.rb in clowne-0.1.0.beta1 vs lib/clowne/cloner.rb in clowne-0.1.0.pre1
- old
+ new
@@ -36,12 +36,12 @@
@traits ||= {}
@traits[name] ||= Declarations::Trait.new
@traits[name].extend_with(block)
end
- # rubocop: disable Metrics/AbcSize, Metrics/MethodLength
- # rubocop: disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
+ # rubocop: disable Metrics/AbcSize
+ # rubocop: disable Metrics/MethodLength
def call(object, **options)
raise(UnprocessableSourceError, 'Nil is not cloneable object') if object.nil?
raise(ConfigurationError, 'Adapter is not defined') if adapter.nil?
@@ -54,16 +54,14 @@
default_plan
else
plan_with_traits(traits)
end
- plan = Clowne::Planner.enhance(plan, Proc.new) if block_given?
-
adapter.clone(object, plan, params: options)
end
- # rubocop: enable Metrics/AbcSize, Metrics/MethodLength
- # rubocop: enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
+ # rubocop: enable Metrics/AbcSize
+ # rubocop: enable Metrics/MethodLength
def default_plan
return @default_plan if instance_variable_defined?(:@default_plan)
@default_plan = Clowne::Planner.compile(self)
end