Sha256: fcdb61592d38b4c92e1f52a7ca62a1458d6f905e74be27499d5e9b744038cf53

Contents?: true

Size: 1.47 KB

Versions: 7

Compression:

Stored size: 1.47 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class All
# Set: All cards (Pattern)
#
module Pattern;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/core/set/all/pattern.rb"; end
def patterns?
  defined? @patterns
end

def all_patterns
  @all_patterns ||= set_patterns.map { |sub| sub.new self }.compact
end

# new cards do not
def patterns
  @patterns ||= (new_card? ? all_patterns[1..-1] : all_patterns)
end

def reset_patterns
  # Rails.logger.info "resetting patterns: #{name}"
  @patterns = @all_patterns = nil
  @template = @virtual = nil
  @set_mods_loaded = @set_modules = @set_names = @rule_set_keys = nil
  @junction_only = nil # only applies to set cards
  true
end

def safe_set_keys
  patterns.map(&:safe_key).reverse * " "
end

def set_modules
  @set_modules ||= all_patterns[0..-2].reverse.map(&:module_list).flatten.compact
end

def set_format_modules klass
  @set_format_modules ||= {}
  @set_format_modules[klass] =
    all_patterns[0..-2].reverse.map do |pattern|
      pattern.format_module_list klass
    end.flatten.compact
end

def set_names
  @set_names = patterns.map(&:to_s) if @set_names.nil?
  @set_names
end

def in_set? set_module
  patterns.map(&:module_key).include? set_module.shortname
end

def rule_set_keys
  @rule_set_keys ||= patterns.map(&:rule_set_key).compact
end

def include_module? set
  singleton_class&.include? set
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card/mod/core/set/all/pattern.rb ~~

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
card-1.101.5 tmpsets/set/mod002-core/all/pattern.rb
card-1.101.4 tmpsets/set/mod002-core/all/pattern.rb
card-1.101.3 tmpsets/set/mod002-core/all/pattern.rb
card-1.101.2 tmpsets/set/mod002-core/all/pattern.rb
card-1.101.1 tmpsets/set/mod002-core/all/pattern.rb
card-1.101.0 tmpsets/set/mod002-core/all/pattern.rb
card-1.100.0 tmpsets/set/mod003-core/all/pattern.rb