Class: RBS::AST::Declarations::Class::Super
- Inherits:
-
Object
- Object
- RBS::AST::Declarations::Class::Super
- Defined in:
- lib/rbs/ast/declarations.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(name:, args:) ⇒ Super
constructor
A new instance of Super.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(name:, args:) ⇒ Super
Returns a new instance of Super.
140 141 142 143 |
# File 'lib/rbs/ast/declarations.rb', line 140 def initialize(name:, args:) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
138 139 140 |
# File 'lib/rbs/ast/declarations.rb', line 138 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
137 138 139 |
# File 'lib/rbs/ast/declarations.rb', line 137 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
145 146 147 |
# File 'lib/rbs/ast/declarations.rb', line 145 def ==(other) other.is_a?(Super) && other.name == name && other.args == args end |
#hash ⇒ Object
151 152 153 |
# File 'lib/rbs/ast/declarations.rb', line 151 def hash self.class.hash ^ name.hash ^ args.hash end |
#to_json(*a) ⇒ Object
155 156 157 158 159 160 |
# File 'lib/rbs/ast/declarations.rb', line 155 def to_json(*a) { name: name, args: args }.to_json(*a) end |