Sha256: 91f9348edca480800e154fbf98d70de2aa7772a9adf084b2e1c4f2bbdded7e9a

Contents?: true

Size: 785 Bytes

Versions: 15

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

require "securerandom"

module Meibo
  class Builder
    module OrganizationBuilder
      extend BaseBuilder

      def self.builder_attribute_names
        %i[builder parent]
      end

      def initialize(builder:, sourced_id: SecureRandom.uuid, parent: nil, **kw)
        super(sourced_id: sourced_id, parent_sourced_id: parent&.sourced_id, **kw)
        @builder = builder
        @parent = parent
        builder.organizations << self
      end

      def build_course(**kw)
        builder.build_course(organization: self, **kw)
      end

      def build_user(**kw)
        builder.build_user(primary_organization: self, **kw)
      end

      def build_role(**kw)
        builder.build_role(organization: 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/organization_builder.rb
meibo-0.27.0 lib/meibo/builder/organization_builder.rb
meibo-0.26.0 lib/meibo/builder/organization_builder.rb
meibo-0.25.3 lib/meibo/builder/organization_builder.rb
meibo-0.25.2 lib/meibo/builder/organization_builder.rb
meibo-0.25.1 lib/meibo/builder/organization_builder.rb
meibo-0.25.0 lib/meibo/builder/organization_builder.rb
meibo-0.24.0 lib/meibo/builder/organization_builder.rb
meibo-0.23.0 lib/meibo/builder/organization_builder.rb
meibo-0.22.0 lib/meibo/builder/organization_builder.rb
meibo-0.21.0 lib/meibo/builder/organization_builder.rb
meibo-0.20.0 lib/meibo/builder/organization_builder.rb
meibo-0.19.0 lib/meibo/builder/organization_builder.rb
meibo-0.18.0 lib/meibo/builder/organization_builder.rb
meibo-0.17.0 lib/meibo/builder/organization_builder.rb