Module: Card::Set::All::Chunk
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod003-core/all/chunk.rb
Overview
Set: All cards (Chunk)
Defined Under Namespace
Modules: Format
Class Method Summary collapse
Instance Method Summary collapse
- #chunks(content, type, named = false) ⇒ Object
- #each_item_name_with_options(content = nil) ⇒ Object
-
#link_chunks(content = nil, named = false) ⇒ Object
named=true rejects external links (since the don't refer to a card name).
-
#nest_chunks(content = nil, named = true) ⇒ Object
named=true rejects commented nests.
- #reference_chunks(content = nil, named = true) ⇒ Object
Methods included from I18nScope
Methods included from Loader
#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set
Methods included from Helpers
#abstract_set?, #all_set?, #num_set_parts, #shortname, #underscore
Methods included from Card::Set::AdvancedApi
#attachment, #ensure_set, #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 Basket
#abstract_basket, #add_to_basket, #basket, #unshift_basket
Methods included from Trait
#card_accessor, #card_reader, #card_writer, #require_field
Methods included from Event::Api
Class Method Details
.source_location ⇒ Object
7 |
# File 'tmpsets/set/mod003-core/all/chunk.rb', line 7 def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/core/set/all/chunk.rb"; end |
Instance Method Details
#chunks(content, type, named = false) ⇒ Object
9 10 11 12 13 14 |
# File 'tmpsets/set/mod003-core/all/chunk.rb', line 9 def chunks content, type, named=false content ||= self.content type ||= Card::Content::Chunk 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
30 31 32 33 34 35 |
# File 'tmpsets/set/mod003-core/all/chunk.rb', line 30 def content=nil reference_chunks(content).each do |chunk| = chunk.respond_to?(:options) ? chunk. : {} yield chunk.referee_name, end end |
#link_chunks(content = nil, named = false) ⇒ Object
named=true rejects external links (since the don't refer to a card name)
26 27 28 |
# File 'tmpsets/set/mod003-core/all/chunk.rb', line 26 def link_chunks content=nil, named=false chunks content, Card::Content::Chunk::Link, named end |