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.



77
78
79
80
# File 'lib/rbs/ast/declarations.rb', line 77

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



75
76
77
# File 'lib/rbs/ast/declarations.rb', line 75

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



74
75
76
# File 'lib/rbs/ast/declarations.rb', line 74

def name
  @name
end

Instance Method Details

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



82
83
84
# File 'lib/rbs/ast/declarations.rb', line 82

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

#hashObject



88
89
90
# File 'lib/rbs/ast/declarations.rb', line 88

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

#to_json(*a) ⇒ Object



92
93
94
95
96
97
# File 'lib/rbs/ast/declarations.rb', line 92

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