Class: Rigor::Inference::VoidOrigin
- Inherits:
-
Data
- Object
- Data
- Rigor::Inference::VoidOrigin
- Defined in:
- lib/rigor/inference/void_origin.rb,
sig/rigor/inference/void_origin.rbs
Overview
VoidOrigin = Data.define(:class_name, :method_name, :kind). Declared as a ::Data subclass because
that is the shape the runtime actually builds; sig-gen cannot yet read a Data.define assignment
(it reports the block body's #label against the enclosing namespace and drops the members).
Instance Attribute Summary collapse
-
#class_name ⇒ String
The receiver class whose method declared
-> void. -
#kind ⇒ Symbol
:instanceor:singleton. -
#method_name ⇒ Symbol
The method whose return was recovered.
Class Method Summary collapse
Instance Method Summary collapse
-
#label ⇒ String
A human-facing
Class#method/Class.methodlabel for the diagnostic message.
Instance Attribute Details
#class_name ⇒ String
Returns the receiver class whose method declared -> void.
17 18 19 20 21 22 23 |
# File 'lib/rigor/inference/void_origin.rb', line 17 VoidOrigin = Data.define(:class_name, :method_name, :kind) do # A human-facing `Class#method` / `Class.method` label for the diagnostic message. def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end end |
#kind ⇒ Symbol
Returns :instance or :singleton.
17 18 19 20 21 22 23 |
# File 'lib/rigor/inference/void_origin.rb', line 17 VoidOrigin = Data.define(:class_name, :method_name, :kind) do # A human-facing `Class#method` / `Class.method` label for the diagnostic message. def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end end |
#method_name ⇒ Symbol
Returns the method whose return was recovered.
17 18 19 20 21 22 23 |
# File 'lib/rigor/inference/void_origin.rb', line 17 VoidOrigin = Data.define(:class_name, :method_name, :kind) do # A human-facing `Class#method` / `Class.method` label for the diagnostic message. def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end end |
Class Method Details
.new(class_name:, method_name:, kind:) ⇒ instance .new(class_name, method_name, kind) ⇒ instance
11 12 |
# File 'sig/rigor/inference/void_origin.rbs', line 11
def self.new: (class_name: String, method_name: Symbol, kind: Symbol) -> instance
| (String class_name, Symbol method_name, Symbol kind) -> instance
|
Instance Method Details
#label ⇒ String
A human-facing Class#method / Class.method label for the diagnostic message.
19 20 21 22 |
# File 'lib/rigor/inference/void_origin.rb', line 19 def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end |