Sha256: a599e65cbe71c5367d3b0fa29bb954ad22f7d810bd73a520d7e74b27927d4959
Contents?: true
Size: 594 Bytes
Versions: 12
Compression:
Stored size: 594 Bytes
Contents
# frozen_string_literal: true module Valkyrie # A simple ID class to keep IDs distinguished from strings # In order for an object to be queryable via joins, it needs # to be added as a reference via a Valkyrie::ID rather than just a string ID. class ID attr_reader :id delegate :empty?, to: :id def initialize(id) @id = id.to_s end def to_s id end delegate :hash, to: :state def eql?(other) other.class == self.class && other.state == state end alias == eql? protected def state [@id] end end end
Version data entries
12 entries across 12 versions & 1 rubygems