class Contracts::Builtin::CollectionOf::Factory

Public Class Methods

new(collection_class, &before_new) click to toggle source
# File lib/contracts/builtin_contracts.rb, line 295
def initialize(collection_class, &before_new)
  @collection_class = collection_class
  @before_new = before_new
end

Public Instance Methods

[](contract)
Alias for: new
new(contract) click to toggle source
# File lib/contracts/builtin_contracts.rb, line 300
def new(contract)
  @before_new && @before_new.call
  CollectionOf.new(@collection_class, contract)
end
Also aliased as: []