Class: Paru::PandocFilter::Target
- Inherits:
-
Object
- Object
- Paru::PandocFilter::Target
- Defined in:
- lib/paru/filter/target.rb
Overview
A Target represents the target of a link or image
Instance Attribute Summary collapse
-
#title ⇒ String
The title of the target.
-
#url ⇒ String
The target.
Instance Method Summary collapse
-
#initialize(contents) ⇒ Target
constructor
Create a new Target based on the contents.
-
#to_ast ⇒ Array
Create an AST representation of this Target.
Constructor Details
#initialize(contents) ⇒ Target
Create a new Target based on the contents
34 35 36 37 |
# File 'lib/paru/filter/target.rb', line 34 def initialize(contents) @url = contents[0] @title = contents[1] end |
Instance Attribute Details
#title ⇒ String
Returns the title of the target.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/paru/filter/target.rb', line 28 class Target attr_accessor :url, :title # Create a new Target based on the contents # # @param contents [Array] def initialize(contents) @url = contents[0] @title = contents[1] end # Create an AST representation of this Target # # @return [Array] def to_ast() [ @url, @title ] end end |
#url ⇒ String
Returns the target.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/paru/filter/target.rb', line 28 class Target attr_accessor :url, :title # Create a new Target based on the contents # # @param contents [Array] def initialize(contents) @url = contents[0] @title = contents[1] end # Create an AST representation of this Target # # @return [Array] def to_ast() [ @url, @title ] end end |
Instance Method Details
#to_ast ⇒ Array
Create an AST representation of this Target
42 43 44 45 46 47 |
# File 'lib/paru/filter/target.rb', line 42 def to_ast() [ @url, @title ] end |