Class: Docks::Tags::IncludeWith
- Defined in:
- lib/docks/tags/include_with_tag.rb
Constant Summary
Constants included from Processors
Processors::CODE_BLOCK_INDICATOR, Processors::HEADING_INDICATOR, Processors::HEADING_UNDERLINE_INDICATOR, Processors::LIST_ITEM_INDICATOR
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ IncludeWith
constructor
A new instance of IncludeWith.
- #process(symbol) ⇒ Object
- #setup_post_processors ⇒ Object
Methods inherited from Base
#multiline?, #multiple_allowed?, #parseable?, #synonyms, #type
Methods included from Processors
#code_block_with_language_and_description, #ensure_valid_demo_type, #join_with_smart_line_breaks, #multiline_description, #name_and_parenthetical, #parenthetical_options, #split_on_characters, #split_on_commas_spaces_and_pipes, #split_on_top_level_parens_commas_and_pipes, #split_types, #stringy_boolean
Constructor Details
#initialize ⇒ IncludeWith
Returns a new instance of IncludeWith.
4 5 6 7 8 |
# File 'lib/docks/tags/include_with_tag.rb', line 4 def initialize @name = :include_with @multiline = false @multiple_allowed = true end |
Instance Method Details
#process(symbol) ⇒ Object
10 11 12 13 14 |
# File 'lib/docks/tags/include_with_tag.rb', line 10 def process(symbol) symbol.update(@name) do |include_with| Array(include_with).map { |with| split_on_commas_spaces_and_pipes(with) }.flatten end end |
#setup_post_processors ⇒ Object
16 17 18 19 20 21 |
# File 'lib/docks/tags/include_with_tag.rb', line 16 def setup_post_processors after_each_pattern(:late) do |pattern| components = pattern.components components.each { |component| find_and_associate_inclusion(component, components) } end end |