Sha256: b999d7a882dba0a06bab10bc98e6871c9c817e22cd04d871bd91dc6408df8906
Contents?: true
Size: 647 Bytes
Versions: 2
Compression:
Stored size: 647 Bytes
Contents
module Tdc module Generators # # Knows how to contain arbitrary collections of model objects. As model instances are created # by generators, the model instances are added to the current catalog as catalog entries. # class CatalogEntries < OpenStruct def add_catalog_entry(tag, entry) send(:"#{tag}=", entry) end def empty? to_h.empty? end def entries to_h.keys end def first to_h.first&.second end def single_entry raise Tdc::FatalError, "There is more than one entry" if to_h.many? first end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tdc-1.1 | lib/tdc/generators/catalog_entries.rb |
tdc-1.0 | lib/tdc/generators/catalog_entries.rb |