Class: Substring
Instance Attribute Summary collapse
-
#range ⇒ Object
readonly
Returns the value of attribute range.
Instance Method Summary collapse
-
#initialize(str, idx, len) ⇒ Substring
constructor
A new instance of Substring.
Methods inherited from String
#longest_common_substrings_with, #to_default_external
Constructor Details
#initialize(str, idx, len) ⇒ Substring
Returns a new instance of Substring.
189 190 191 192 |
# File 'lib/adlint/prelude.rb', line 189 def initialize(str, idx, len) @range = idx...(idx + len) super(str.slice(@range)) end |
Instance Attribute Details
#range ⇒ Object (readonly)
Returns the value of attribute range.
194 195 196 |
# File 'lib/adlint/prelude.rb', line 194 def range @range end |