Class: Decode::Syntax::Link
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Attributes inherited from Match
Instance Method Summary collapse
- #apply(output, rewriter) ⇒ Object
-
#initialize(range, definition) ⇒ Link
constructor
A new instance of Link.
Methods inherited from Match
Constructor Details
#initialize(range, definition) ⇒ Link
Returns a new instance of Link.
11 12 13 14 15 |
# File 'lib/decode/syntax/link.rb', line 11 def initialize(range, definition) @definition = definition super(range) end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
17 18 19 |
# File 'lib/decode/syntax/link.rb', line 17 def definition @definition end |
Instance Method Details
#apply(output, rewriter) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/decode/syntax/link.rb', line 19 def apply(output, rewriter) output << rewriter.link_to( @definition, rewriter.text_for(@range) ) return self.size end |