Class: RBS::AST::Declarations::Module
- Includes:
- MixinHelper, NestedDeclarationHelper
- Defined in:
- lib/rbs/ast/declarations.rb
Defined Under Namespace
Classes: Self
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#self_types ⇒ Object
readonly
Returns the value of attribute self_types.
-
#type_params ⇒ Object
readonly
Returns the value of attribute type_params.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(name:, type_params:, members:, self_types:, annotations:, location:, comment:) ⇒ Module
constructor
A new instance of Module.
- #to_json(state = _ = nil) ⇒ Object
Methods included from MixinHelper
Methods included from NestedDeclarationHelper
Constructor Details
#initialize(name:, type_params:, members:, self_types:, annotations:, location:, comment:) ⇒ Module
Returns a new instance of Module.
280 281 282 283 284 285 286 287 288 |
# File 'lib/rbs/ast/declarations.rb', line 280 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 ⇒ Object (readonly)
Returns the value of attribute annotations.
276 277 278 |
# File 'lib/rbs/ast/declarations.rb', line 276 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
278 279 280 |
# File 'lib/rbs/ast/declarations.rb', line 278 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
275 276 277 |
# File 'lib/rbs/ast/declarations.rb', line 275 def location @location end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
274 275 276 |
# File 'lib/rbs/ast/declarations.rb', line 274 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
272 273 274 |
# File 'lib/rbs/ast/declarations.rb', line 272 def name @name end |
#self_types ⇒ Object (readonly)
Returns the value of attribute self_types.
277 278 279 |
# File 'lib/rbs/ast/declarations.rb', line 277 def self_types @self_types end |
#type_params ⇒ Object (readonly)
Returns the value of attribute type_params.
273 274 275 |
# File 'lib/rbs/ast/declarations.rb', line 273 def type_params @type_params end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
290 291 292 293 294 295 296 |
# File 'lib/rbs/ast/declarations.rb', line 290 def ==(other) other.is_a?(Module) && other.name == name && other.type_params == type_params && other.self_types == self_types && other.members == members end |
#hash ⇒ Object
300 301 302 |
# File 'lib/rbs/ast/declarations.rb', line 300 def hash self.class.hash ^ name.hash ^ type_params.hash ^ self_types.hash ^ members.hash end |
#to_json(state = _ = nil) ⇒ Object
304 305 306 307 308 309 310 311 312 313 314 315 |
# File 'lib/rbs/ast/declarations.rb', line 304 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 |