Class: Pinspec::Analyzer::Discovery::Choice

Inherits:
Data
  • Object
show all
Defined in:
lib/pinspec/analyzer/discovery.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#candidatesObject (readonly)

Returns the value of attribute candidates

Returns:

  • (Object)

    the current value of candidates



20
21
22
# File 'lib/pinspec/analyzer/discovery.rb', line 20

def candidates
  @candidates
end

#method_nameObject (readonly)

Returns the value of attribute method_name

Returns:

  • (Object)

    the current value of method_name



20
21
22
# File 'lib/pinspec/analyzer/discovery.rb', line 20

def method_name
  @method_name
end

#ownerObject (readonly)

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



20
21
22
# File 'lib/pinspec/analyzer/discovery.rb', line 20

def owner
  @owner
end

#reasonObject (readonly)

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



20
21
22
# File 'lib/pinspec/analyzer/discovery.rb', line 20

def reason
  @reason
end

Instance Method Details

#ambiguous?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/pinspec/analyzer/discovery.rb', line 21

def ambiguous?
  method_name.nil?
end

#descriptorObject

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