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.



172
173
174
175
176
# File 'lib/rbs/definition.rb', line 172

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



170
171
172
# File 'lib/rbs/definition.rb', line 170

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



170
171
172
# File 'lib/rbs/definition.rb', line 170

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



170
171
172
# File 'lib/rbs/definition.rb', line 170

def source
  @source
end

Instance Method Details

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



178
179
180
# File 'lib/rbs/definition.rb', line 178

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

#hashObject



184
185
186
# File 'lib/rbs/definition.rb', line 184

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