Sha256: 5b52e1b97a92a5afa85de4f4310d71d58d4b7926904da9a8964140cc2a22b4de
Contents?: true
Size: 554 Bytes
Versions: 7
Compression:
Stored size: 554 Bytes
Contents
class ReeDto::BuildDtoCollectionClass include Ree::FnDSL fn :build_dto_collection_class do link "ree_dto/dto/dto_collection", -> { DtoCollection } end contract Any => Class def call(entity_contract) Class.new(DtoCollection) do contract entity_contract => nil def add(item) @list ||= [] @list.push(item) nil end contract entity_contract => Nilor[entity_contract] def remove(item) @list.delete(item) end alias :<< :add alias :push :add end end end
Version data entries
7 entries across 7 versions & 1 rubygems