Class: Jade::Frontend::SemanticAnalysis::Error::ConstructorNotFound
- Defined in:
- lib/jade/frontend/semantic_analysis/error/constructor_not_found.rb
Instance Attribute Summary collapse
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(entry, span, name:, exposed_type_module: nil, candidates: []) ⇒ ConstructorNotFound
constructor
A new instance of ConstructorNotFound.
- #label ⇒ Object
- #message ⇒ Object
- #queried_name ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(entry, span, name:, exposed_type_module: nil, candidates: []) ⇒ ConstructorNotFound
Returns a new instance of ConstructorNotFound.
8 9 10 11 12 13 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_not_found.rb', line 8 def initialize(entry, span, name:, exposed_type_module: nil, candidates: []) @name = name @exposed_type_module = exposed_type_module @candidates = candidates super(entry:, span:) end |
Instance Attribute Details
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates.
6 7 8 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_not_found.rb', line 6 def candidates @candidates end |
Instance Method Details
#label ⇒ Object
23 24 25 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_not_found.rb', line 23 def label "not found" end |
#message ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_not_found.rb', line 15 def base = "I cannot find a `#{@name}` constructor" return base unless @exposed_type_module "#{base}. The type `#{@name}` is exposed by `#{@exposed_type_module}` but its " \ "constructor is private — add `#{@name}(..)` to that module's `exposing` list." end |
#queried_name ⇒ Object
27 28 29 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_not_found.rb', line 27 def queried_name @name end |