Class: Tins::MethodDescription::Parameters::Parameter

Inherits:
Struct
  • Object
show all
Defined in:
lib/tins/method_description.rb

Overview

Base class for all parameter types.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



11
12
13
# File 'lib/tins/method_description.rb', line 11

def name
  @name
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



11
12
13
# File 'lib/tins/method_description.rb', line 11

def type
  @type
end

Instance Method Details

#==(other) ⇒ Boolean

Compares two parameters by their type.

Parameters:

  • other (Parameter)

    The other parameter to compare against

Returns:

  • (Boolean)

    Whether the types are equal



16
17
18
# File 'lib/tins/method_description.rb', line 16

def ==(other)
  type == other.type
end

#inspectString

Returns a string representation of the parameter for debugging.

Returns:

  • (String)

    A debug-friendly representation



23
24
25
# File 'lib/tins/method_description.rb', line 23

def inspect
  "#<#{self.class} #{to_s.inspect}>"
end