class Tdc::Generators::CatalogEntries

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.

Public Instance Methods

add_catalog_entry(tag, entry) click to toggle source
# File lib/tdc/generators/catalog_entries.rb, line 8
def add_catalog_entry(tag, entry)
  send("#{tag}=", entry)
end
empty?() click to toggle source
# File lib/tdc/generators/catalog_entries.rb, line 12
def empty?
  to_h.empty?
end
entries() click to toggle source
# File lib/tdc/generators/catalog_entries.rb, line 16
def entries
  to_h.keys
end
first() click to toggle source
# File lib/tdc/generators/catalog_entries.rb, line 20
def first
  to_h.first&.second
end
single_entry() click to toggle source
# File lib/tdc/generators/catalog_entries.rb, line 24
def single_entry
  raise Tdc::FatalError, "There is more than one entry" if to_h.many?

  first
end