Module: Card::Set::Abstract::CodeFile

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod003-content/abstract/02_code_file.rb

Overview

Set: Abstract (CodeFile)

Defined Under Namespace

Modules: HtmlFormat

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

.included(host_class) ⇒ Object



12
13
14
# File 'platypus/tmp/set/gem-defaults/mod003-content/abstract/02_code_file.rb', line 12

def included host_class
  track_mod_name host_class, caller
end

.source_locationObject



7
# File 'platypus/tmp/set/gem-defaults/mod003-content/abstract/02_code_file.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/mod/content/set/abstract/02_code_file.rb"; end

.track_mod_name(host_class, caller) ⇒ Object



16
17
18
19
# File 'platypus/tmp/set/gem-defaults/mod003-content/abstract/02_code_file.rb', line 16

def track_mod_name host_class, caller
  host_class.mattr_accessor :file_content_mod_name
  host_class.file_content_mod_name = Card::Set.mod_name(caller)
end

Instance Method Details

#contentObject



26
27
28
29
30
31
32
33
# File 'platypus/tmp/set/gem-defaults/mod003-content/abstract/02_code_file.rb', line 26

def content
  Array.wrap(source_paths).map do |path|
    if (source_path = find_file path)
      Rails.logger.debug "reading file: #{source_path}"
      ::File.read source_path
    end
  end.compact.join "\n"
end

#source_pathsObject



22
23
24
# File 'platypus/tmp/set/gem-defaults/mod003-content/abstract/02_code_file.rb', line 22

def source_paths
  # OVERRIDE to use paths for content
end