Class: Interscript::Node::Item::CaptureRef
- Inherits:
-
Interscript::Node::Item
- Object
- Interscript::Node
- Interscript::Node::Item
- Interscript::Node::Item::CaptureRef
- Defined in:
- lib/interscript/node/item/capture.rb,
lib/interscript/visualize/nodes.rb
Overview
1
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Attributes inherited from Interscript::Node::Item
Instance Method Summary collapse
- #==(other) ⇒ Object
- #first_string ⇒ Object (also: #nth_string)
-
#initialize(id) ⇒ CaptureRef
constructor
A new instance of CaptureRef.
- #inspect ⇒ Object
- #to_hash ⇒ Object
- #to_html(_) ⇒ Object
Methods inherited from Interscript::Node::Item
Constructor Details
#initialize(id) ⇒ CaptureRef
Returns a new instance of CaptureRef.
39 40 41 |
# File 'lib/interscript/node/item/capture.rb', line 39 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
37 38 39 |
# File 'lib/interscript/node/item/capture.rb', line 37 def id @id end |
Instance Method Details
#==(other) ⇒ Object
54 55 56 |
# File 'lib/interscript/node/item/capture.rb', line 54 def ==(other) super && self.id == other.id end |
#first_string ⇒ Object Also known as: nth_string
43 44 45 |
# File 'lib/interscript/node/item/capture.rb', line 43 def first_string self end |
#inspect ⇒ Object
58 59 60 |
# File 'lib/interscript/node/item/capture.rb', line 58 def inspect "ref(#{@id.inspect})" end |
#to_hash ⇒ Object
49 50 51 52 |
# File 'lib/interscript/node/item/capture.rb', line 49 def to_hash { :class => self.class.to_s, :id => self.id } end |
#to_html(_) ⇒ Object
50 51 52 53 54 |
# File 'lib/interscript/visualize/nodes.rb', line 50 def to_html(_) "<nobr>capture reference (</nobr>" + id.to_s + ")" end |