Module: Card::Set::All::Data

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod004-format/all/data.rb

Overview

Set: All cards (Data)

Defined Under Namespace

Modules: DataFormat

Constant Summary

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Card::Set

reset

Methods included from I18nScope

#mod_name, #scope

Methods included from Registrar

#extended, #finalize_load, #process_base_modules, #register_set

Methods included from Helpers

#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name

Methods included from Card::Set::AdvancedApi

#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #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 Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



7
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/mod/format/set/all/data.rb"; end

Instance Method Details

#castObject



8
9
10
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 8

def cast
  real? ? { id: id } : { name: name, type_id: type_id, content: db_content }
end

#pod_contentObject



34
35
36
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 34

def pod_content
  structure ? nil : db_content
end

#pod_fields(marks) ⇒ Object



20
21
22
23
24
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 20

def pod_fields marks
  marks.each_with_object({}) do |mark, hash|
    hash[mark] = [name, mark].card&.pod_content
  end.compact_blank
end

#pod_hash(field_tags: []) ⇒ Object



12
13
14
15
16
17
18
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 12

def pod_hash field_tags: []
  { name: pod_name,
    type: pod_type,
    codename: codename,
    content: pod_content,
    fields: pod_fields(field_tags) }.compact_blank
end

#pod_nameObject



30
31
32
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 30

def pod_name
  simple? ? name.s : name.part_names.map(&:codename_or_string)
end

#pod_typeObject



26
27
28
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/data.rb', line 26

def pod_type
  type_name.codename_or_string
end