Sha256: 10d032106413239245f1b795c729fc0a697f509147e11cfe57e568fad630f226

Contents?: true

Size: 279 Bytes

Versions: 46

Compression:

Stored size: 279 Bytes

Contents

require 'set'

module Dataset
  class Collection < Array # :nodoc:
    def initialize(parent)
      concat parent
    end
    
    def <<(dataset)
      super
      uniq!
      self
    end
    
    def subset?(other)
      Set.new(self).subset?(Set.new(other))
    end
  end
end

Version data entries

46 entries across 46 versions & 8 rubygems

Version Path
aiwilliams-dataset-1.2.0 lib/dataset/collection.rb
aiwilliams-dataset-1.3.0 lib/dataset/collection.rb
aiwilliams-dataset-1.3.1 lib/dataset/collection.rb
karsthammer-dataset-1.2.0 lib/dataset/collection.rb
radiant-1.1.4 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.3 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.2 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.1 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.0 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.0.rc1 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.0.beta vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.1 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.1.0.alpha vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.0 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.0.rc5 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.0.rc4 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.0.rc3 vendor/plugins/dataset/lib/dataset/collection.rb
kajam-1.0.3.rc2 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.0.rc2 vendor/plugins/dataset/lib/dataset/collection.rb
radiant-1.0.0.rc1 vendor/plugins/dataset/lib/dataset/collection.rb