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



67
68
69
# File 'lib/pinspec/types.rb', line 67

def args
  @args
end

#ctor_argsObject (readonly)

Returns the value of attribute ctor_args

Returns:

  • (Object)

    the current value of ctor_args



67
68
69
# File 'lib/pinspec/types.rb', line 67

def ctor_args
  @ctor_args
end

#ctor_kwargsObject (readonly)

Returns the value of attribute ctor_kwargs

Returns:

  • (Object)

    the current value of ctor_kwargs



67
68
69
# File 'lib/pinspec/types.rb', line 67

def ctor_kwargs
  @ctor_kwargs
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



67
68
69
# File 'lib/pinspec/types.rb', line 67

def id
  @id
end

#kwargsObject (readonly)

Returns the value of attribute kwargs

Returns:

  • (Object)

    the current value of kwargs



67
68
69
# File 'lib/pinspec/types.rb', line 67

def kwargs
  @kwargs
end

#originObject (readonly)

Returns the value of attribute origin

Returns:

  • (Object)

    the current value of origin



67
68
69
# File 'lib/pinspec/types.rb', line 67

def origin
  @origin
end

Instance Method Details

#signatureObject



68
69
70
# File 'lib/pinspec/types.rb', line 68

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

#to_sObject



72
73
74
75
76
77
78
79
80
# File 'lib/pinspec/types.rb', line 72

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