Sha256: 82d697e2f1dcc7b89750019f5120569ddfa59b416ec95ca012d7cc4bbedfb58b

Contents?: true

Size: 1.26 KB

Versions: 10

Compression:

Stored size: 1.26 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Type
# Set: All "Set" cards
#
module Set;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/follow/set/type/set.rb"; end
event :cache_expired_for_new_set, :store, on: :create do
  Card.follow_caches_expired
end

def list_direct_followers?
  true
end

def follow_label
  if (klass = subclass_for_set)
    klass.short_label name.left_name
  else
    ""
  end
end

def follow_rule_name user=nil
  Card::Name[[name, user, :follow].compact]
end

def followed_by? user_id=nil
  all_members_followed_by? user_id
end

def follow_set_card
  self
end

def all_members_followed?
  all_members_followed_by? Auth.current_id
end

def all_members_followed_by? user_id=nil
  return false unless prototype.followed_by?(user_id)

  directly_followed_by?(user_id) || broader_set_followed_by?(user_id)
end

def broader_set_followed_by? user_id
  broader_sets.find do |set_name|
    Card.fetch(set_name)&.directly_followed_by? user_id
  end
end

def directly_followed?
  directly_followed_by? Auth.current_id
end

def directly_followed_by? user_id=nil
  return true if user_id && follow_rule?(user_id)

  follow_rule?
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/follow/set/type/set.rb ~~

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
card-1.100.0 tmpsets/set/mod017-follow/type/set.rb
card-1.99.4 tmpsets/set/mod017-follow/type/set.rb
card-1.99.3 tmpsets/set/mod017-follow/type/set.rb
card-1.99.2 tmpsets/set/mod017-follow/type/set.rb
card-1.99.1 tmpsets/set/mod017-follow/type/set.rb
card-1.99.0 tmpsets/set/mod017-follow/type/set.rb
card-1.98.3 tmpsets/set/mod017-follow/type/set.rb
card-1.98.2 tmpsets/set/mod017-follow/type/set.rb
card-1.98.1 tmpsets/set/mod017-follow/type/set.rb
card-1.98.0 tmpsets/set/mod017-follow/type/set.rb