Module: Consumer::PositionStore::ClassConfigure

Defined in:
lib/consumer/position_store.rb

Instance Method Summary collapse

Instance Method Details

#configure(receiver, *arguments, attr_name: nil, **keyword_arguments) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/consumer/position_store.rb', line 30

def configure(receiver, *arguments, attr_name: nil, **keyword_arguments)
  attr_name ||= :position_store

  if keyword_arguments.any?
    position_store = build(*arguments, **keyword_arguments)
  else
    position_store = build(*arguments)
  end

  receiver.public_send("#{attr_name}=", position_store)

  position_store
end