Class: Pinspec::InputCase

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



75
76
77
# File 'lib/pinspec/types.rb', line 75

def args
  @args
end

#ctor_argsObject (readonly)

Returns the value of attribute ctor_args

Returns:

  • (Object)

    the current value of ctor_args



75
76
77
# File 'lib/pinspec/types.rb', line 75

def ctor_args
  @ctor_args
end

#ctor_kwargsObject (readonly)

Returns the value of attribute ctor_kwargs

Returns:

  • (Object)

    the current value of ctor_kwargs



75
76
77
# File 'lib/pinspec/types.rb', line 75

def ctor_kwargs
  @ctor_kwargs
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



75
76
77
# File 'lib/pinspec/types.rb', line 75

def id
  @id
end

#kwargsObject (readonly)

Returns the value of attribute kwargs

Returns:

  • (Object)

    the current value of kwargs



75
76
77
# File 'lib/pinspec/types.rb', line 75

def kwargs
  @kwargs
end

#originObject (readonly)

Returns the value of attribute origin

Returns:

  • (Object)

    the current value of origin



75
76
77
# File 'lib/pinspec/types.rb', line 75

def origin
  @origin
end

Instance Method Details

#signatureObject



76
77
78
# File 'lib/pinspec/types.rb', line 76

def signature
  [ctor_args, ctor_kwargs, args, kwargs]
end

#to_sObject



80
81
82
83
84
85
86
87
88
# File 'lib/pinspec/types.rb', line 80

def to_s
  ctor = render(ctor_args, ctor_kwargs)
  meth = render(args, kwargs)

  receiver = ctor_args.empty? && ctor_kwargs.empty? ? "" : "new(#{ctor})."
  invocation = meth.empty? ? "call" : "call(#{meth})"

  "#{id} (#{origin}) #{receiver}#{invocation}"
end