Sha256: 94ec6cc39d6e9d54a690167e6f784448ecfa29129a5b518ead5ea12a2d210212

Contents?: true

Size: 891 Bytes

Versions: 15

Compression:

Stored size: 891 Bytes

Contents

# frozen_string_literal: true

require "securerandom"

module Meibo
  class Builder
    module UserBuilder
      extend BaseBuilder

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

      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

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
meibo-0.27.1 lib/meibo/builder/user_builder.rb
meibo-0.27.0 lib/meibo/builder/user_builder.rb
meibo-0.26.0 lib/meibo/builder/user_builder.rb
meibo-0.25.3 lib/meibo/builder/user_builder.rb
meibo-0.25.2 lib/meibo/builder/user_builder.rb
meibo-0.25.1 lib/meibo/builder/user_builder.rb
meibo-0.25.0 lib/meibo/builder/user_builder.rb
meibo-0.24.0 lib/meibo/builder/user_builder.rb
meibo-0.23.0 lib/meibo/builder/user_builder.rb
meibo-0.22.0 lib/meibo/builder/user_builder.rb
meibo-0.21.0 lib/meibo/builder/user_builder.rb
meibo-0.20.0 lib/meibo/builder/user_builder.rb
meibo-0.19.0 lib/meibo/builder/user_builder.rb
meibo-0.18.0 lib/meibo/builder/user_builder.rb
meibo-0.17.0 lib/meibo/builder/user_builder.rb