Class: RubocopTodoCorrector::DescriptionRenderer
- Inherits:
-
Object
- Object
- RubocopTodoCorrector::DescriptionRenderer
- Defined in:
- lib/rubocop_todo_corrector/description_renderer.rb
Constant Summary collapse
- TEMPLATE_PATH =
::File.('../../templates/description.md.erb', __dir__)
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ String
-
#initialize(cop_document:, cop_name:, cop_url:) ⇒ DescriptionRenderer
constructor
A new instance of DescriptionRenderer.
Constructor Details
#initialize(cop_document:, cop_name:, cop_url:) ⇒ DescriptionRenderer
Returns a new instance of DescriptionRenderer.
29 30 31 32 33 34 35 36 37 |
# File 'lib/rubocop_todo_corrector/description_renderer.rb', line 29 def initialize( cop_document:, cop_name:, cop_url: ) @cop_document = cop_document @cop_name = cop_name @cop_url = cop_url end |
Class Method Details
.call(cop_document:, cop_name:, cop_url:) ⇒ String
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rubocop_todo_corrector/description_renderer.rb', line 16 def call( cop_document:, cop_name:, cop_url: ) new( cop_document:, cop_name:, cop_url: ).call end |
Instance Method Details
#call ⇒ String
40 41 42 |
# File 'lib/rubocop_todo_corrector/description_renderer.rb', line 40 def call ::ERB.new(template_content, trim_mode: '-').result(binding) end |