Class: Paru::PandocFilter::Link
- Defined in:
- lib/paru/filter/link.rb
Overview
A Link node has an attribute object, an Inline description and a target
Direct Known Subclasses
Instance Attribute Summary collapse
Attributes inherited from Node
Instance Method Summary collapse
-
#ast_contents ⇒ Object
Create an AST representation of this Link node.
-
#initialize(contents) ⇒ Link
constructor
Create a new Link node with contents.
Methods inherited from Inline
Methods included from InnerMarkdown
#inner_markdown, #inner_markdown=
Methods inherited from Node
#ast_type, #can_act_as_both_block_and_inline?, #each, from_markdown, #get_replacement, #has_been_replaced?, #has_block?, #has_children?, #has_class?, #has_inline?, #has_parent?, #has_string?, #is_block?, #is_inline?, #is_leaf?, #is_node?, #is_root?, #markdown, #markdown=, #toMetadata, #to_ast, #to_s, #type
Methods included from ASTManipulation
#append, #delete, #each_depth_first, #find_index, #get, #insert, #prepend, #remove_at, #replace, #replace_at
Constructor Details
#initialize(contents) ⇒ Link
Create a new Link node with contents
42 43 44 45 46 |
# File 'lib/paru/filter/link.rb', line 42 def initialize(contents) @attr = Attr.new contents[0] super(contents[1]) @target = Target.new contents[2] end |
Instance Attribute Details
#attr ⇒ Attr
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/paru/filter/link.rb', line 35 class Link < Inline attr_accessor :attr, :target # Create a new Link node with contents # # @param contents [Array] an array with attributes, description, # and target information def initialize(contents) @attr = Attr.new contents[0] super(contents[1]) @target = Target.new contents[2] end # Create an AST representation of this Link node def ast_contents [ @attr.to_ast, super, @target.to_ast ] end end |
#target ⇒ Target
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/paru/filter/link.rb', line 35 class Link < Inline attr_accessor :attr, :target # Create a new Link node with contents # # @param contents [Array] an array with attributes, description, # and target information def initialize(contents) @attr = Attr.new contents[0] super(contents[1]) @target = Target.new contents[2] end # Create an AST representation of this Link node def ast_contents [ @attr.to_ast, super, @target.to_ast ] end end |
Instance Method Details
#ast_contents ⇒ Object
Create an AST representation of this Link node
49 50 51 52 53 54 55 |
# File 'lib/paru/filter/link.rb', line 49 def ast_contents [ @attr.to_ast, super, @target.to_ast ] end |