Double colon in class name and RubyMine short name complaint

I have the following auto-generated controller in Regulators / v 2 / base_controller.rb .

class V2::BaseController < ApplicationController
end

It was created by the pearl Top . I am trying to create a controller inherited from V2::BaseController. I wrote

class V2::MainController < V2::BaseController
  def index
    render :text => 'abcde'
  end
end

It works great, and I see that my text is displayed in the browser. However, the RubyMine IDE complains that the class name V2is V2::MainControllertoo short, and I have to rename the class.

I got confused because I thought it V2::means that we are defining a new class inside the module V2. If I am wrong, why does RubyMine ignore the same problem with BaseController?

UPD : RubyMine complaint

Complaint RubyMine

+4
2

RubyMine reek .

, .

:

  • 1-
  • ,

2 V2. Version2 .

. Ruby .

+4

, . , , .

, V2 , , , Version2, Rubymine . , - . , Rubymine .

IDE MainController?

:

  • RubyMine. , , , ( , ). IDE , .
  • RubyMine V2, V2 in class V2::MainController -, . : , .

//v2.rb

module V2
end
+1

Source: https://habr.com/ru/post/1609122/


All Articles