Sha256: f794e894a2893409a615ccafce80df2ebf3ec11123accdb06033398c7c69e0b7

Contents?: true

Size: 333 Bytes

Versions: 10

Compression:

Stored size: 333 Bytes

Contents

module Marvin::IRC::Server
  class NamedStore
    
    def self.new(key_plural, ref_value, &blk)
      klass = Class.new(Hash) do
        alias_method :"each_#{ref_value}", :each_value
        alias_method key_plural.to_sym, :keys
      end
      klass.class_eval(&blk) unless blk.blank?
      return klass.new
    end
    
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
Sutto-marvin-0.2.0 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.2.1 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.2.2 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.2.3 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.2.4 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.3.0 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.3.2 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.3.3 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.3.4 lib/marvin/irc/server/named_store.rb
Sutto-marvin-0.4.0 lib/marvin/irc/server/named_store.rb