Sha256: ab1790ecd13f15d98395ff1a9855608bb3b138728f1a83f6388fbcf28ffb8fb7

Contents?: true

Size: 531 Bytes

Versions: 3

Compression:

Stored size: 531 Bytes

Contents

module BqFactory
  class RegistoryDecorator
    attr_reader :registory

    def initialize(registory)
      @registory = registory
    end

    def register(name, table)
      name = name.to_sym

      if registered?(name)
        raise DuplicateDefinitionError.new, "#{registory.name} already registered: #{name}"
      else
        registory.register(name, table)
      end
    end

    def registered?(name)
      registory.registered? name.to_sym
    end

    def find(name)
      registory.find(name.to_sym)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bq_factory-0.2.0 lib/bq_factory/registory_decorator.rb
bq_factory-0.1.1 lib/bq_factory/registory_decorator.rb
bq_factory-0.1.0 lib/bq_factory/registory_decorator.rb