Class: Typocop::Cops

Inherits:
Object
  • Object
show all
Defined in:
lib/typocop/cops.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cops_data) ⇒ Cops

Returns a new instance of Cops.



5
6
7
8
9
# File 'lib/typocop/cops.rb', line 5

def initialize(cops_data)
  @cops = cops_data.map do |data|
    Cop.new(data[:path], data[:line], data[:typos])
  end
end

Instance Attribute Details

#copsObject (readonly)

Returns the value of attribute cops.



3
4
5
# File 'lib/typocop/cops.rb', line 3

def cops
  @cops
end

#lineObject (readonly)

Returns the value of attribute line.



3
4
5
# File 'lib/typocop/cops.rb', line 3

def line
  @line
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/typocop/cops.rb', line 3

def path
  @path
end