Sha256: b39d934426f42f50ada3921a90f0e84b852e8aa6372cc0fd53d840f6d92d09b1

Contents?: true

Size: 1.46 KB

Versions: 49

Compression:

Stored size: 1.46 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class All; module Export; extend Card::Set
# ~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/export.rb ~~
format :json do
  def default_export_args args
    args[:count] ||= 0
    args[:count] += 1
    args[:processed_keys] ||= ::Set.new
  end

  # export the card itself and all nested content (up to 10 levels deep)
  view :export do |args|
    # avoid loops
    return [] if args[:count] > 10 || args[:processed_keys].include?(card.key)
    args[:processed_keys] << card.key

    Array.wrap(render_atom(args)).concat(
      render_export_items(count: args[:count])
    )
  end

  def default_export_items_args args
    args[:processed_keys] ||= ::Set.new
  end

  # export all nested content (up to 10 levels deep)
  view :export_items do |args|
    result = []
    each_nested_chunk do |chunk|
      next if main_nest? chunk
      next unless (r_card = chunk.referee_card)
      next if r_card.new? || r_card == card
      next if args[:processed_keys].include?(r_card.key)
      result << r_card
    end
    result.uniq!
    result.map! { |ca| subformat(ca).render_export(args) }
    result.flatten.reject(&:blank?)
  end

  def main_nest? chunk
    chunk.respond_to?(:options) && chunk.options && chunk.options[:inc_name] &&
      chunk.options[:inc_name] == "_main"
  end
end


# ~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/export.rb ~~
end;end;end;end;

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
card-1.93.12 tmpsets/set/mod002-core/all/export.rb
card-1.93.11 tmpsets/set/mod002-core/all/export.rb
card-1.93.10 tmpsets/set/mod002-core/all/export.rb
card-1.93.9 tmpsets/set/mod002-core/all/export.rb
card-1.93.8 tmpsets/set/mod002-core/all/export.rb
card-1.93.7 tmpsets/set/mod002-core/all/export.rb
card-1.93.6 tmpsets/set/mod002-core/all/export.rb
card-1.93.5 tmpsets/set/mod002-core/all/export.rb
card-1.93.4 tmpsets/set/mod002-core/all/export.rb
card-1.93.3 tmpsets/set/mod002-core/all/export.rb
card-1.93.2 tmpsets/set/mod002-core/all/export.rb
card-1.93.1 tmpsets/set/mod002-core/all/export.rb
card-1.93.0 tmpsets/set/mod002-core/all/export.rb
card-1.92.2 tmpsets/set/mod002-core/all/export.rb
card-1.92.1 tmpsets/set/mod002-core/all/export.rb
card-1.92 tmpsets/set/mod002-core/all/export.rb
card-1.21.0 tmpsets/set/mod001-core/all/export.rb
card-1.20.4 tmpsets/set/mod001-core/all/export.rb
card-1.20.3 tmpsets/set/mod001-core/all/export.rb
card-1.20.2 tmpsets/set/mod001-core/all/export.rb