Class: BulletmarkRepairer::Marker
- Inherits:
-
Object
- Object
- BulletmarkRepairer::Marker
- Defined in:
- lib/bulletmark_repairer/markers.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
-
#base_class ⇒ Object
readonly
Returns the value of attribute base_class.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#instance_variable_name ⇒ Object
readonly
Returns the value of attribute instance_variable_name.
-
#line_no ⇒ Object
readonly
Returns the value of attribute line_no.
-
#retry ⇒ Object
readonly
Returns the value of attribute retry.
Instance Method Summary collapse
- #add_association(notification) ⇒ Object
-
#initialize(notification, controller:, action:) ⇒ Marker
constructor
A new instance of Marker.
- #n_plus_one_in_view? ⇒ Boolean
- #skip? ⇒ Boolean
Constructor Details
#initialize(notification, controller:, action:) ⇒ Marker
Returns a new instance of Marker.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/bulletmark_repairer/markers.rb', line 33 def initialize(notification, controller:, action:) @base_class = notification.instance_variable_get(:@base_class) @stacktraces = notification.instance_variable_get(:@callers) @associations = notification.instance_variable_get(:@associations) @controller = controller @action = action @retry = false @line_no = nil set_up end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def action @action end |
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def associations @associations end |
#base_class ⇒ Object (readonly)
Returns the value of attribute base_class.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def base_class @base_class end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def file_name @file_name end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def index @index end |
#instance_variable_name ⇒ Object (readonly)
Returns the value of attribute instance_variable_name.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def instance_variable_name @instance_variable_name end |
#line_no ⇒ Object (readonly)
Returns the value of attribute line_no.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def line_no @line_no end |
#retry ⇒ Object (readonly)
Returns the value of attribute retry.
31 32 33 |
# File 'lib/bulletmark_repairer/markers.rb', line 31 def retry @retry end |
Instance Method Details
#add_association(notification) ⇒ Object
44 45 46 |
# File 'lib/bulletmark_repairer/markers.rb', line 44 def add_association(notification) @associations += notification.instance_variable_get(:@associations) end |
#n_plus_one_in_view? ⇒ Boolean
53 54 55 |
# File 'lib/bulletmark_repairer/markers.rb', line 53 def n_plus_one_in_view? @n_plus_one_in_view end |
#skip? ⇒ Boolean
48 49 50 51 |
# File 'lib/bulletmark_repairer/markers.rb', line 48 def skip? log_patchable_files_not_be_found index.nil? || file_name.remove("#{Rails.root}/").in?(BulletmarkRepairer.config.skip_file_list) end |