Sha256: 96a388818a0da33e75430b0b4c098ec04fbb021d7e6ab3f5ffa89f4056ae24b4

Contents?: true

Size: 385 Bytes

Versions: 2

Compression:

Stored size: 385 Bytes

Contents

require 'hyper_admin/resource'

module HyperAdmin
  class ResourceCollection
    attr_reader :resources

    def initialize
      @resources = {}
    end

    def add(resource_class)
      resource = Resource.new(resource_class)
      @resources[resource_class.model_name] = resource

      resource
    end

    def each(&block)
      @resources.values.each(&block)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyper_admin-0.3.0 lib/hyper_admin/resource_collection.rb
hyper_admin-0.2.0 lib/hyper_admin/resource_collection.rb