module Card::Query::CardQuery::ReferenceAttributes

interpret CQL attributes that involve references from one card to another

Public Class Methods

define_reference_method(methodname, reftype, ref_method, ref_field) click to toggle source
# File lib/card/query/card_query/reference_attributes.rb, line 6
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

Public Instance Methods

member(val) click to toggle source
# File lib/card/query/card_query/reference_attributes.rb, line 39
def member val
  interpret type_id: Card::RoleID,
            right_plus: [{ codename: "members" }, refer_to: val]
end
member_of(val) click to toggle source

shortcut methods for role references DEPRECATE?

# File lib/card/query/card_query/reference_attributes.rb, line 35
def member_of val
  interpret referred_to_by: { left: val, right: { codename: "members" } }
end