Class: RBS::AST::Declarations::Module
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base
|
|
Instance Chain:
|
|
Inherits: |
RBS::AST::Declarations::Base
|
Defined in: | lib/rbs/ast/declarations.rb |
Class Method Summary
Instance Attribute Summary
- #annotations readonly
- #comment readonly
- #location readonly
- #members readonly
- #name readonly
- #self_types readonly
- #type_params readonly
Instance Method Summary
- #==(other) (also: #eql?)
- #eql?(other)
- #hash
- #to_json(state = _ = nil)
MixinHelper
- Included
NestedDeclarationHelper
- Included
Constructor Details
.new(name:, type_params:, members:, self_types:, annotations:, location:, comment:) ⇒ Module
# File 'lib/rbs/ast/declarations.rb', line 185
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
Instance Attribute Details
#annotations (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 181
attr_reader :annotations
#comment (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 183
attr_reader :comment
#location (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 180
attr_reader :location
#members (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 179
attr_reader :members
#name (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 177
attr_reader :name
#self_types (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 182
attr_reader :self_types
#type_params (readonly)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 178
attr_reader :type_params
Instance Method Details
#==(other) Also known as: #eql?
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 195
def ==(other) other.is_a?(Module) && other.name == name && other.type_params == type_params && other.self_types == self_types && other.members == members end
#eql?(other)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 203
alias eql? ==
#hash
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 205
def hash self.class.hash ^ name.hash ^ type_params.hash ^ self_types.hash ^ members.hash end
#to_json(state = _ = nil)
[ GitHub ]# File 'lib/rbs/ast/declarations.rb', line 209
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