Sha256: 3556c7e1c48be8a7ef6e261502c962ee95c81639116ae51d8342ca0dfe85758b

Contents?: true

Size: 236 Bytes

Versions: 6

Compression:

Stored size: 236 Bytes

Contents

class SiteHub
  module CollectionMethods
    def collection(hash, item)
      hash[item] || []
    end

    def collection!(hash, item)
      return hash[item] if hash[item]
      raise ConfigError, "missing: #{item}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sitehub-0.5.0.alpha12 lib/sitehub/collection_methods.rb
sitehub-0.5.0.alpha11 lib/sitehub/collection_methods.rb
sitehub-0.5.0.alpha10 lib/sitehub/collection_methods.rb
sitehub-0.5.0.alpha8 lib/sitehub/collection_methods.rb
sitehub-0.5.0.alpha7 lib/sitehub/collection_methods.rb
sitehub-0.5.0.alpha6 lib/sitehub/collection_methods.rb