Class: Rails::Annotate::Solargraph::Scope
- Inherits:
-
Object
- Object
- Rails::Annotate::Solargraph::Scope
- Defined in:
- lib/rails/annotate/solargraph/scope.rb
Overview
Represents a scope on an ActiveRecord Model.
Instance Attribute Summary collapse
- #definition ⇒ Object readonly
- #model_class ⇒ Object readonly
- #name ⇒ Object readonly
- #proc_parameters ⇒ Object readonly
Instance Method Summary collapse
- #documentation ⇒ String
-
#initialize(name:, model_class:, proc_parameters:, definition:) ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize(name:, model_class:, proc_parameters:, definition:) ⇒ Scope
Returns a new instance of Scope.
21 22 23 24 25 26 27 |
# File 'lib/rails/annotate/solargraph/scope.rb', line 21 def initialize(name:, model_class:, proc_parameters:, definition:) @name = name @model_class = model_class @proc_parameters = proc_parameters @definition = definition freeze end |
Instance Attribute Details
#definition ⇒ Object (readonly)
15 16 17 |
# File 'lib/rails/annotate/solargraph/scope.rb', line 15 def definition @definition end |
#model_class ⇒ Object (readonly)
11 12 13 |
# File 'lib/rails/annotate/solargraph/scope.rb', line 11 def model_class @model_class end |
#name ⇒ Object (readonly)
9 10 11 |
# File 'lib/rails/annotate/solargraph/scope.rb', line 9 def name @name end |
#proc_parameters ⇒ Object (readonly)
13 14 15 |
# File 'lib/rails/annotate/solargraph/scope.rb', line 13 def proc_parameters @proc_parameters end |
Instance Method Details
#documentation ⇒ String
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rails/annotate/solargraph/scope.rb', line 30 def documentation <<~DOC # # Scope `#{@name.inspect}`. # # #{documented_definition} # # # # @return [Array<#{@model_class}>, nil] # #{signature} DOC end |