Sha256: 211b8576f219472ce01bcfd00ffd6f5a61d763641e06a39e58d7d4838c0964a0

Contents?: true

Size: 369 Bytes

Versions: 2

Compression:

Stored size: 369 Bytes

Contents

# frozen_string_literal: true

module Acb
  class Registry
    class ColumnNotFound < StandardError; end

    def initialize
      @registrations = []
    end

    def push(master_column)
      @registrations.push(master_column)
    end

    def lookup(key)
      @registrations.find { |registration| registration.key == key } or raise ColumnNotFound
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acb-0.2.1 lib/acb/registry.rb
acb-0.2.0 lib/acb/registry.rb