Module: Card::Set::Type::Cardtype

Extended by:
Card::Set
Includes:
Basic
Defined in:
tmpsets/set/mod017-follow/type/cardtype.rb,
tmpsets/set/mod021-standard/type/cardtype.rb

Overview

Set: All “Cardtype” cards

Defined Under Namespace

Modules: HtmlFormat

Class Method Summary collapse

Instance Method Summary collapse

Methods included from I18nScope

#mod_name, #scope

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set

Methods included from Helpers

#abstract_set?, #all_set?, #num_set_parts, #shortname, #underscore

Methods included from AdvancedApi

#attachment, #ensure_set, #stage_method

Methods included from Format

#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Basket

#abstract_basket, #add_to_basket, #basket, #unshift_basket

Methods included from Card::Set::Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



7
# File 'tmpsets/set/mod017-follow/type/cardtype.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/follow/set/type/cardtype.rb"; end

Instance Method Details

#cards_of_type_exist?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'tmpsets/set/mod021-standard/type/cardtype.rb', line 82

def cards_of_type_exist?
  !new_card? && Card.where(trash: false, type_id: id).exists?
end

#create_ok?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'tmpsets/set/mod021-standard/type/cardtype.rb', line 86

def create_ok?
  Card.new(type_id: id).ok? :create
end

#follow_labelObject



8
9
10
# File 'tmpsets/set/mod017-follow/type/cardtype.rb', line 8

def follow_label
  follow_set_card.follow_label
end

#follow_set_cardObject



16
17
18
# File 'tmpsets/set/mod017-follow/type/cardtype.rb', line 16

def follow_set_card
  Card.fetch name, :type
end

#followed_by?(user_id = nil) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'tmpsets/set/mod017-follow/type/cardtype.rb', line 12

def followed_by? user_id=nil
  follow_set_card.all_members_followed_by? user_id
end

#list_direct_followers?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'tmpsets/set/mod017-follow/type/cardtype.rb', line 20

def list_direct_followers?
  true
end

#wql_hashObject



10
11
12
# File 'tmpsets/set/mod021-standard/type/cardtype.rb', line 10

def wql_hash
  { type_id: id, sort: :name }
end