Module: Card::Set::All::Chunk

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod003-content/all/chunk.rb

Overview

Set: All cards (Chunk)

Defined Under Namespace

Modules: Format

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/mod003-content/all/chunk.rb', line 7

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

Instance Method Details

#chunks(content, type = nil, named = false) ⇒ Object



8
9
10
11
12
# File 'platypus/tmp/set/gem-defaults/mod003-content/all/chunk.rb', line 8

def chunks content, type=nil, named=false
  content ||= self.content
  all_chunks = Card::Content.new(content, self).find_chunks type
  named ? all_chunks.select(&:referee_name) : all_chunks
end

#each_item_name_with_options(content = nil) ⇒ Object



28
29
30
31
32
33
# File 'platypus/tmp/set/gem-defaults/mod003-content/all/chunk.rb', line 28

def each_item_name_with_options content=nil
  reference_chunks(content).each do |chunk|
    options = chunk.respond_to?(:options) ? chunk.options : {}
    yield chunk.referee_name, options
  end
end

named=true rejects external links (since the don’t refer to a card name)



24
25
26
# File 'platypus/tmp/set/gem-defaults/mod003-content/all/chunk.rb', line 24

def link_chunks content=nil, named=false
  chunks content, :Link, named
end

#nest_chunks(content = nil, named = true) ⇒ Object

named=true rejects commented nests



19
20
21
# File 'platypus/tmp/set/gem-defaults/mod003-content/all/chunk.rb', line 19

def nest_chunks content=nil, named=true
  chunks content, :Nest, named
end

#reference_chunks(content = nil, named = true) ⇒ Object



14
15
16
# File 'platypus/tmp/set/gem-defaults/mod003-content/all/chunk.rb', line 14

def reference_chunks content=nil, named=true
  chunks content, :Reference, named
end