Sha256: f8c7c9ba8c51f8fa0243c6b51033c0928b1c43a7e4592abd0ed05c5996df558d

Contents?: true

Size: 324 Bytes

Versions: 1

Compression:

Stored size: 324 Bytes

Contents

module Egi
  class Group
    def initialize(name = nil)
      @tags = name ? [ name ] : [ ]
    end

    def items
      @items ||= Hash.new {|hash, key| hash[key] = Item[:name => key, :tags => @tags] }
    end

    def item(name, hash)
      items[name.to_sym].update(hash)
      self # for method chain
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
egi-0.0.2 lib/egi/group.rb