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
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.
Constructor Details
Instance Attribute Details
#attr ⇒ Attr
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/paru/filter/link.rb', line 33 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
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/paru/filter/link.rb', line 33 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
47 48 49 50 51 52 53 |
# File 'lib/paru/filter/link.rb', line 47 def ast_contents [ @attr.to_ast, super, @target.to_ast ] end |