Sha256: 88912dcc50ba81cb540ea1ef4c0d53ddf1efb1ae3e2e2010bc77382368691bf3
Contents?: true
Size: 1.16 KB
Versions: 13
Compression:
Stored size: 1.16 KB
Contents
class Card module Query class CardQuery # interpret CQL attributes that involve references from one card to another module ReferenceAttributes def self.define_reference_method methodname, reftype, ref_method, ref_field define_method methodname do |val| tie :reference, { ref_method => { reftype: reftype, card: val } }, to: ref_field end end { refer_to: %w[L I], link_to: "L", include: "I" }.each do |methodname, reftype| define_reference_method methodname, reftype, :referee, :referer_id end { referred_to_by: %w[L I], linked_to_by: "L", included_by: "I" }.each do |methodname, reftype| define_reference_method methodname, reftype, :referer, :referee_id end # shortcut methods for role references # DEPRECATE? def member_of val interpret right_plus: [RolesID, refer_to: val] end def member val interpret referred_to_by: { left: val, right: RolesID } end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems