class RBS::AST::Declarations::Class
Attributes
annotations
[R]
Array[Annotation]
comment
[R]
Comment?
location
[R]
loc?
members
[R]
Array[member]
Public Class Methods
(name: TypeName, type_params: Array[TypeParam], members: Array[member], super_class: Super?, annotations: Array[Annotation], location: loc?, comment: Comment?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 97 def initialize(name:, type_params:, super_class:, members:, annotations:, location:, comment:) @name = name @type_params = type_params @super_class = super_class @members = members @annotations = annotations @location = location @comment = comment end
Public Instance Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 119 def ==(other) other.is_a?(Class) && other.name == name && other.type_params == type_params && other.super_class == super_class && other.members == members end
Also aliased as: eql?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 129 def hash self.class.hash ^ name.hash ^ type_params.hash ^ super_class.hash ^ members.hash end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 133 def to_json(state = nil) { declaration: :class, name: name, type_params: type_params, members: members, super_class: super_class, annotations: annotations, location: location, comment: comment }.to_json(state) end
(?name: TypeName, ?type_params: Array[TypeParam], ?members: Array[member], ?super_class: Super?, ?annotations: Array[Annotation], ?location: loc?, ?comment: Comment?) → Declarations::Class
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 107 def update(name: self.name, type_params: self.type_params, super_class: self.super_class, members: self.members, annotations: self.annotations, location: self.location, comment: self.comment) self.class.new( name: name, type_params: type_params, super_class: super_class, members: members, annotations: annotations, location: location, comment: comment ) end