Class: Jiminy::Reporting::NPlusOne
- Inherits:
-
Object
- Object
- Jiminy::Reporting::NPlusOne
- Defined in:
- lib/jiminy/reporting/n_plus_one.rb
Constant Summary collapse
- ERB_SAFE_LEVEL =
nil
- TRIM_MODE =
"-"
Instance Attribute Summary collapse
-
#blob_url ⇒ Object
Returns the value of attribute blob_url.
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #blob_url_with_line ⇒ Object
-
#initialize(file:, line:, method:, examples: []) ⇒ NPlusOne
constructor
A new instance of NPlusOne.
- #to_markdown ⇒ Object
Constructor Details
#initialize(file:, line:, method:, examples: []) ⇒ NPlusOne
Returns a new instance of NPlusOne.
17 18 19 20 21 22 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 17 def initialize(file:, line:, method:, examples: []) @examples = examples @file = file @line = line @method = method end |
Instance Attribute Details
#blob_url ⇒ Object
Returns the value of attribute blob_url.
15 16 17 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 15 def blob_url @blob_url end |
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
13 14 15 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 13 def examples @examples end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
13 14 15 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 13 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
13 14 15 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 13 def line @line end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
13 14 15 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 13 def method @method end |
Instance Method Details
#blob_url_with_line ⇒ Object
28 29 30 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 28 def blob_url_with_line "#{blob_url}#L#{line}" end |
#to_markdown ⇒ Object
24 25 26 |
# File 'lib/jiminy/reporting/n_plus_one.rb', line 24 def to_markdown ERB.new(markdown_template, trim_mode: TRIM_MODE).result(binding) end |