Sha256: 2a567a56e89f2e0462149033b9ce328229c7bc33d7a1144561396bc8b7f8f80c

Contents?: true

Size: 837 Bytes

Versions: 14

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

module Cmor
  module Legal
    class PersonalDataRegistry
      extend ActiveModel::Translation
      extend ActiveModel::Naming

      attr_accessor :personal_data

      delegate :first, :last, :[], :each, :map, :collect, to: :personal_data

      def initialize
        @personal_data = []
      end

      def self.instance
        @@instance
      end

      def self.all
        instance.personal_data
      end

      def self.count
        instance.personal_data.size
      end

      def self.attribute_names
        [:personal_data]
      end

      def register(root, options, &block)
        self.personal_data << PersonalData.new(root: root, options: options, block: block)
      end

      @@instance = Cmor::Legal::PersonalDataRegistry.new

      private_class_method :new
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
cmor_legal-0.0.60.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.59.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.58.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.57.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.56.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.55.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.54.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.53.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.52.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.51.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.50.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.49.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.48.pre app/registries/cmor/legal/personal_data_registry.rb
cmor_legal-0.0.45.pre app/registries/cmor/legal/personal_data_registry.rb