Sha256: a3699c2a3c8e650c6adda3b8c34f63cc401a107c2011684cfaf4c3ee02d24981

Contents?: true

Size: 468 Bytes

Versions: 17

Compression:

Stored size: 468 Bytes

Contents

# = Registerable
#
# == Copying
#
# Copyright (c) 2007 Tiger Ops

# = Registerable
#
module Registerable

  # Register format names.

  def register(*names)
    names.each do |name|
      registry[name.to_s] = self
    end
  end

  # Access registry.

  def registry
    @@registry ||= {}
  end

  #

  def registry_invalid?(*types)
    bad = []
    types.each do |type|
      bad << type unless @@registry[type]
    end
    return bad.empty? ? false : bad
  end

end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
facets-2.8.4 lib/more/facets/registerable.rb
facets-2.8.3 lib/more/facets/registerable.rb
facets-2.8.2 lib/more/facets/registerable.rb
facets-2.8.1 lib/more/facets/registerable.rb
facets-2.8.0 lib/more/facets/registerable.rb
facets-2.7.0 lib/more/facets/registerable.rb
facets-2.6.0 lib/more/facets/registerable.rb
facets-2.4.0 lib/facets/registerable.rb
facets-2.4.1 lib/facets/registerable.rb
facets-2.4.2 lib/more/facets/registerable.rb
facets-2.4.4 lib/more/facets/registerable.rb
facets-2.4.3 lib/more/facets/registerable.rb
facets-2.5.1 lib/more/facets/registerable.rb
facets-2.4.5 lib/more/facets/registerable.rb
facets-2.5.0 lib/more/facets/registerable.rb
facets-2.5.2 lib/more/facets/registerable.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/more/facets/registerable.rb