Class: RBS::AST::Declarations::Class::Super

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, args:) ⇒ Super

Returns a new instance of Super.



134
135
136
137
# File 'lib/rbs/ast/declarations.rb', line 134

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



132
133
134
# File 'lib/rbs/ast/declarations.rb', line 132

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



131
132
133
# File 'lib/rbs/ast/declarations.rb', line 131

def name
  @name
end

Instance Method Details

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



139
140
141
# File 'lib/rbs/ast/declarations.rb', line 139

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

#hashObject



145
146
147
# File 'lib/rbs/ast/declarations.rb', line 145

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

#to_json(*a) ⇒ Object



149
150
151
152
153
154
# File 'lib/rbs/ast/declarations.rb', line 149

def to_json(*a)
  {
    name: name,
    args: args
  }.to_json(*a)
end