Module: Card::Set::All::Type

Extended by:
Card::Set
Defined in:
tmpsets/set/mod001-core/all/type.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #pattern_and_modules_from_path, #process_base_modules, #register_set, #tmp_file_template, #write_tmp_file

Methods included from Helpers

#abstract_set?, #all_set?, #shortname

Methods included from Card::Set::AdvancedApi

#attachment, #ensure_set, #stage_method

Methods included from Format

#all_set_format_mod!, #define_on_format, #format, #register_set_format, #view

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Basket

#abstract_basket, #add_to_basket, #basket

Methods included from Trait

#card_accessor, #card_reader, #card_writer

Methods included from Event

#event

Instance Method Details

#get_type_id_from_structureObject



36
37
38
39
40
# File 'tmpsets/set/mod001-core/all/type.rb', line 36

def get_type_id_from_structure
  return unless name && (t = template)
  reset_patterns # still necessary even with new template handling?
  t.type_id
end

#type=(type_name) ⇒ Object



32
33
34
# File 'tmpsets/set/mod001-core/all/type.rb', line 32

def type= type_name
  self.type_id = Card.fetch_id type_name
end

#type_cardObject



11
12
13
14
# File 'tmpsets/set/mod001-core/all/type.rb', line 11

def type_card
  return if type_id.nil?
  Card.quick_fetch type_id.to_i
end

#type_cardnameObject



28
29
30
# File 'tmpsets/set/mod001-core/all/type.rb', line 28

def type_cardname
  type_card.try :cardname
end

#type_codeObject



16
17
18
# File 'tmpsets/set/mod001-core/all/type.rb', line 16

def type_code
  Card::Codename[type_id.to_i]
end

#type_nameObject



20
21
22
# File 'tmpsets/set/mod001-core/all/type.rb', line 20

def type_name
  type_card.try :name
end

#type_name_or_defaultObject



24
25
26
# File 'tmpsets/set/mod001-core/all/type.rb', line 24

def type_name_or_default
  type_card.try(:name) || Card.quick_fetch(Card.default_type_id).name
end