class RBS::AST::Declarations::Module
Attributes
annotations
[R]
Array[Annotation]
comment
[R]
Comment?
location
[R]
loc?
members
[R]
Array[member]
self_types
[R]
Array[Self]
Public Class Methods
(name: TypeName, type_params: Array[TypeParam], members: Array[member], location: loc?, annotations: Array[Annotation], self_types: Array[Self], comment: Comment?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 197 def initialize(name:, type_params:, members:, self_types:, annotations:, location:, comment:) @name = name @type_params = type_params @self_types = self_types @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 220 def ==(other) other.is_a?(Module) && other.name == name && other.type_params == type_params && other.self_types == self_types && 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 230 def hash self.class.hash ^ name.hash ^ type_params.hash ^ self_types.hash ^ members.hash end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 234 def to_json(state = nil) { declaration: :module, name: name, type_params: type_params, members: members, self_types: self_types, annotations: annotations, location: location, comment: comment }.to_json(state) end
(?name: TypeName, ?type_params: Array[TypeParam], ?members: Array[member], ?location: loc?, ?annotations: Array[Annotation], ?self_types: Array[Self], ?comment: Comment?) → Declarations::Module
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 207 def update(name: self.name, type_params: self.type_params, members: self.members, self_types: self.self_types, annotations: self.annotations, location: self.location, comment: self.comment) self.class.new( name: name, type_params: type_params, members: members, self_types: self_types, annotations: annotations, location: location, comment: comment ) end