Class: Steep::TypeInference::MethodParams::BaseRestParameter

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/type_inference/method_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:, node:) ⇒ BaseRestParameter

Returns a new instance of BaseRestParameter.



62
63
64
65
66
# File 'lib/steep/type_inference/method_params.rb', line 62

def initialize(name:, type:, node:)
  @name = name
  @type = type
  @node = node
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



58
59
60
# File 'lib/steep/type_inference/method_params.rb', line 58

def name
  @name
end

#nodeObject (readonly)

Returns the value of attribute node.



60
61
62
# File 'lib/steep/type_inference/method_params.rb', line 60

def node
  @node
end

#typeObject (readonly)

Returns the value of attribute type.



59
60
61
# File 'lib/steep/type_inference/method_params.rb', line 59

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



68
69
70
71
72
73
# File 'lib/steep/type_inference/method_params.rb', line 68

def ==(other)
  other.class == self.class &&
    other.name == name &&
    other.type == type &&
    other.node == node
end

#hashObject



77
78
79
# File 'lib/steep/type_inference/method_params.rb', line 77

def hash
  self.class.hash ^ name.hash ^ type.hash ^ node.hash
end