Class: Pinspec::Analyzer::Discovery::Choice
- Inherits:
-
Data
- Object
- Data
- Pinspec::Analyzer::Discovery::Choice
- Defined in:
- lib/pinspec/analyzer/discovery.rb
Instance Attribute Summary collapse
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #ambiguous? ⇒ Boolean
-
#descriptor ⇒ Object
def self.call(...)delegating todef callis the commonest service-object idiom in Ruby, and it makes the bare name resolve to two definitions.
Instance Attribute Details
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates
20 21 22 |
# File 'lib/pinspec/analyzer/discovery.rb', line 20 def candidates @candidates end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name
20 21 22 |
# File 'lib/pinspec/analyzer/discovery.rb', line 20 def method_name @method_name end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner
20 21 22 |
# File 'lib/pinspec/analyzer/discovery.rb', line 20 def owner @owner end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason
20 21 22 |
# File 'lib/pinspec/analyzer/discovery.rb', line 20 def reason @reason end |
Instance Method Details
#ambiguous? ⇒ Boolean
21 22 23 |
# File 'lib/pinspec/analyzer/discovery.rb', line 21 def ambiguous? method_name.nil? end |
#descriptor ⇒ Object
def self.call(...) delegating to def call is the commonest service-object
idiom in Ruby, and it makes the bare name resolve to two definitions. The
instance method is the real entry point, so it is named explicitly rather
than left to look ambiguous.
29 30 31 |
# File 'lib/pinspec/analyzer/discovery.rb', line 29 def descriptor owner ? "#{owner}##{method_name}" : method_name end |