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.
391 392 393 394 |
# File 'lib/review/preprocessor.rb', line 391 def initialize(number, string) @number = number @string = string end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
396 397 398 |
# File 'lib/review/preprocessor.rb', line 396 def number @number end |
#string ⇒ Object (readonly) Also known as: to_s
Returns the value of attribute string.
397 398 399 |
# File 'lib/review/preprocessor.rb', line 397 def string @string end |
Instance Method Details
#edit ⇒ Object
400 401 402 |
# File 'lib/review/preprocessor.rb', line 400 def edit self.class.new(@number, yield(@string)) end |
#empty? ⇒ Boolean
404 405 406 |
# File 'lib/review/preprocessor.rb', line 404 def empty? @string.strip.empty? end |
#num_indent ⇒ Object
408 409 410 |
# File 'lib/review/preprocessor.rb', line 408 def num_indent @string.slice(/\A\s*/).size end |