Sha256: 4a00cd0f8b259f6c52611513c95df3c588844262a9befcc659c288ec9066f07a

Contents?: true

Size: 373 Bytes

Versions: 4

Compression:

Stored size: 373 Bytes

Contents

class Formats

  def initialize
    @formats = {}
  end

  def [](key)
    symbolized_key = key.to_sym
    if @formats.has_key?(symbolized_key)
      @formats[symbolized_key]
    else
      @formats[symbolized_key] = FileReader.read_format(symbolized_key)
    end
  end

  def loaded?(key)
    @formats.has_key?(key.to_sym)
  end

  def reset!
    @formats = {}
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
sevenwire-forgery-0.2.0 lib/formats.rb
sevenwire-forgery-0.2.1 lib/formats.rb
sevenwire-forgery-0.2.2 lib/formats.rb
forgery-0.2.2 lib/formats.rb