Class: RBS::Definition::Ancestor::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/definition.rb,
sig/definition.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, args:, source:) ⇒ Instance

Returns a new instance of Instance.

Parameters:



213
214
215
216
217
# File 'lib/rbs/definition.rb', line 213

def initialize(name:, args:, source:)
  @name = name
  @args = args
  @source = source
end

Instance Attribute Details

#argsArray[Types::t] (readonly)

Returns the value of attribute args.

Returns:

  • (Array[Types::t])


211
212
213
# File 'lib/rbs/definition.rb', line 211

def args
  @args
end

#nameTypeName (readonly)

Returns the value of attribute name.

Returns:



211
212
213
# File 'lib/rbs/definition.rb', line 211

def name
  @name
end

#sourcesource (readonly)

Returns the value of attribute source.

Returns:



211
212
213
# File 'lib/rbs/definition.rb', line 211

def source
  @source
end

Instance Method Details

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



219
220
221
# File 'lib/rbs/definition.rb', line 219

def ==(other)
  other.is_a?(Instance) && other.name == name && other.args == args
end

#hashObject



225
226
227
# File 'lib/rbs/definition.rb', line 225

def hash
  self.class.hash ^ name.hash ^ args.hash
end