Module: Zen::Service::Plugins::Attributes

Extended by:
Plugin
Defined in:
lib/zen/service/plugins/attributes.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Plugin

config, default_options, extended, register_as, service_extension

Instance Method Details

#initialize(*args) ⇒ Object



8
9
10
11
12
# File 'lib/zen/service/plugins/attributes.rb', line 8

def initialize(*args)
  @attributes = assert_valid_attributes!(resolve_args!(args))

  super()
end

#initialize_cloneObject



14
15
16
17
# File 'lib/zen/service/plugins/attributes.rb', line 14

def initialize_clone(*)
  super
  @attributes = @attributes.dup unless @attributes.nil?
end

#with_attributes(attributes) ⇒ Object



19
20
21
# File 'lib/zen/service/plugins/attributes.rb', line 19

def with_attributes(attributes)
  clone.tap { |copy| copy.attributes.merge!(attributes) }
end