Class: Liquid2::StaticAnalysis::Variable
- Inherits:
-
Object
- Object
- Liquid2::StaticAnalysis::Variable
- Defined in:
- lib/liquid2/static_analysis.rb
Overview
A variable as a sequence of segments and its location.
Constant Summary collapse
- RE_PROPERTY =
/\A[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*\Z/
Instance Attribute Summary collapse
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#span ⇒ Object
readonly
Returns the value of attribute span.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(segments, span) ⇒ Variable
constructor
A new instance of Variable.
- #to_s ⇒ Object
Constructor Details
#initialize(segments, span) ⇒ Variable
Returns a new instance of Variable.
54 55 56 57 |
# File 'lib/liquid2/static_analysis.rb', line 54 def initialize(segments, span) @segments = segments @span = span end |
Instance Attribute Details
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
50 51 52 |
# File 'lib/liquid2/static_analysis.rb', line 50 def segments @segments end |
#span ⇒ Object (readonly)
Returns the value of attribute span.
50 51 52 |
# File 'lib/liquid2/static_analysis.rb', line 50 def span @span end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
63 64 65 66 67 |
# File 'lib/liquid2/static_analysis.rb', line 63 def ==(other) self.class == other.class && @segments == other.segments && @span == other.span end |
#hash ⇒ Object
71 72 73 |
# File 'lib/liquid2/static_analysis.rb', line 71 def hash @segments.hash end |
#to_s ⇒ Object
59 60 61 |
# File 'lib/liquid2/static_analysis.rb', line 59 def to_s segments_to_s(@segments) end |