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.
26 27 28 29 30 |
# File 'lib/decode/syntax/link.rb', line 26 def initialize(range, definition) @definition = definition super(range) end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
32 33 34 |
# File 'lib/decode/syntax/link.rb', line 32 def definition @definition end |
Instance Method Details
#apply(output, rewriter) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/decode/syntax/link.rb', line 34 def apply(output, rewriter) output << rewriter.link_to( @definition, rewriter.text_for(@range) ) return self.size end |