Class: RailsPulse::OperationSuggestions
- Inherits:
-
Object
- Object
- RailsPulse::OperationSuggestions
- Defined in:
- app/services/rails_pulse/operation_suggestions.rb
Constant Summary collapse
- VIEW_TYPES =
%w[template partial layout collection].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(operation, parent) ⇒ OperationSuggestions
constructor
A new instance of OperationSuggestions.
Constructor Details
#initialize(operation, parent) ⇒ OperationSuggestions
Returns a new instance of OperationSuggestions.
9 10 11 12 |
# File 'app/services/rails_pulse/operation_suggestions.rb', line 9 def initialize(operation, parent) @operation = operation @parent = parent end |
Class Method Details
.for(operation, parent: nil) ⇒ Object
5 6 7 |
# File 'app/services/rails_pulse/operation_suggestions.rb', line 5 def self.for(operation, parent: nil) new(operation, parent).generate end |
Instance Method Details
#generate ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/services/rails_pulse/operation_suggestions.rb', line 14 def generate case @operation.operation_type when "sql" then sql_suggestions when *VIEW_TYPES then view_suggestions when "controller" then controller_suggestions when "cache_read" then cache_suggestions when "http" then http_suggestions else [] end end |