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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Instance.



195
196
197
198
199
# File 'lib/rbs/definition.rb', line 195

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



193
194
195
# File 'lib/rbs/definition.rb', line 193

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



193
194
195
# File 'lib/rbs/definition.rb', line 193

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



193
194
195
# File 'lib/rbs/definition.rb', line 193

def source
  @source
end

Instance Method Details

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



201
202
203
# File 'lib/rbs/definition.rb', line 201

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

#hashObject



207
208
209
# File 'lib/rbs/definition.rb', line 207

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