Class: Homebrew::RubocopLineLocation

Inherits:
Object
  • Object
show all
Defined in:
Library/Homebrew/cmd/style.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ RubocopLineLocation

Returns a new instance of RubocopLineLocation



184
185
186
187
188
# File 'Library/Homebrew/cmd/style.rb', line 184

def initialize(json)
  @line = json["line"]
  @column = json["column"]
  @length = json["length"]
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column



182
183
184
# File 'Library/Homebrew/cmd/style.rb', line 182

def column
  @column
end

#lengthObject (readonly)

Returns the value of attribute length



182
183
184
# File 'Library/Homebrew/cmd/style.rb', line 182

def length
  @length
end

#lineObject (readonly)

Returns the value of attribute line



182
183
184
# File 'Library/Homebrew/cmd/style.rb', line 182

def line
  @line
end

Instance Method Details

#to_sObject



190
191
192
# File 'Library/Homebrew/cmd/style.rb', line 190

def to_s
  "#{line}: col #{column} (#{length} chars)"
end

#to_short_sObject



194
195
196
# File 'Library/Homebrew/cmd/style.rb', line 194

def to_short_s
  "#{line}: col #{column}"
end