Class: RDocRuboCop::RDoc::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/rdoc_rubocop/rdoc/line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lineno, str) ⇒ Line

Returns a new instance of Line.



10
11
12
13
# File 'lib/rdoc_rubocop/rdoc/line.rb', line 10

def initialize(lineno, str)
  @lineno = lineno
  @str = str
end

Instance Attribute Details

#linenoObject (readonly)

Returns the value of attribute lineno.



8
9
10
# File 'lib/rdoc_rubocop/rdoc/line.rb', line 8

def lineno
  @lineno
end

#strObject (readonly)

Returns the value of attribute str.



8
9
10
# File 'lib/rdoc_rubocop/rdoc/line.rb', line 8

def str
  @str
end

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rdoc_rubocop/rdoc/line.rb', line 15

def blank?
  /^ *$/.match?(@str)
end

#indentObject



19
20
21
# File 'lib/rdoc_rubocop/rdoc/line.rb', line 19

def indent
  @str.expand_tab.indent
end