Module: Meibo::Builder::UserBuilder

Extended by:
BaseBuilder
Defined in:
lib/meibo/builder/user_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseBuilder

create

Class Method Details

.builder_attribute_namesObject



10
11
12
# File 'lib/meibo/builder/user_builder.rb', line 10

def self.builder_attribute_names
  %i[builder agents primary_organization]
end

Instance Method Details

#build_demographic(**kw) ⇒ Object



27
28
29
# File 'lib/meibo/builder/user_builder.rb', line 27

def build_demographic(**kw)
  builder.build_demographic(user: self, **kw)
end

#build_profile(**kw) ⇒ Object



31
32
33
# File 'lib/meibo/builder/user_builder.rb', line 31

def build_profile(**kw)
  builder.(user: self, **kw)
end

#initialize(builder:, sourced_id: SecureRandom.uuid, agents: nil, primary_organization: nil, **kw) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/meibo/builder/user_builder.rb', line 14

def initialize(builder:, sourced_id: SecureRandom.uuid, agents: nil, primary_organization: nil, **kw)
  super(
    sourced_id: sourced_id,
    agent_sourced_ids: agents&.map(&:sourced_id),
    primary_org_sourced_id: primary_organization&.sourced_id,
    **kw
  )
  @builder = builder
  @agents = agents
  @primary_organization = primary_organization
  builder.users << self
end