Module: Card::Set::Self::Cardtype::HtmlFormat

Extended by:
AbstractFormat
Defined in:
card/tmpsets/set/mod036-card-mod-rules/self/cardtype.rb,
card/tmpsets/set/mod037-card-mod-rules/self/cardtype.rb

Instance Method Summary collapse

Instance Method Details

#custom_typesObject



39
40
41
42
43
44
45
46
47
48
# File 'card/tmpsets/set/mod036-card-mod-rules/self/cardtype.rb', line 39

def custom_types
  custom_types = []

  Card.search(type_id: Card::CardtypeID, return: "name").each do |name|
    next if ::Card::Set::Self::Cardtype::GROUP_MAP[name]

    custom_types << name
  end
  custom_types
end

#view: grouped_listObject



30
31
32
33
34
35
36
37
# File 'card/tmpsets/set/mod036-card-mod-rules/self/cardtype.rb', line 30

view :grouped_list do
  GROUP.keys.map do |group|
    type_list = group == "Custom" ? custom_types : GROUP[group]
    next if type_list.empty?

    [wrap_with(:h5, group), wrap_with(:p, listing(type_list))]
  end.flatten.join "\n"
end