Class: ReVIEW::Line
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#string ⇒ Object
(also: #to_s)
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #edit ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(number, string) ⇒ Line
constructor
A new instance of Line.
- #num_indent ⇒ Object
Constructor Details
#initialize(number, string) ⇒ Line
Returns a new instance of Line.
320 321 322 323 |
# File 'lib/review/preprocessor.rb', line 320 def initialize(number, string) @number = number @string = string end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
325 326 327 |
# File 'lib/review/preprocessor.rb', line 325 def number @number end |
#string ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute string.
326 327 328 |
# File 'lib/review/preprocessor.rb', line 326 def string @string end |
Instance Method Details
#edit ⇒ Object
329 330 331 |
# File 'lib/review/preprocessor.rb', line 329 def edit self.class.new(@number, yield(@string)) end |
#empty? ⇒ Boolean
333 334 335 |
# File 'lib/review/preprocessor.rb', line 333 def empty? @string.strip.empty? end |
#num_indent ⇒ Object
337 338 339 |
# File 'lib/review/preprocessor.rb', line 337 def num_indent @string.slice(/\A\s*/).size end |