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.
185 186 187 188 189 190 191 192 193 |
# 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 ⇒ Object (readonly)
Returns the value of attribute annotations.
181 182 183 |
# File 'lib/rbs/ast/declarations.rb', line 181 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
183 184 185 |
# File 'lib/rbs/ast/declarations.rb', line 183 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
180 181 182 |
# File 'lib/rbs/ast/declarations.rb', line 180 def location @location end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
179 180 181 |
# File 'lib/rbs/ast/declarations.rb', line 179 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
177 178 179 |
# File 'lib/rbs/ast/declarations.rb', line 177 def name @name end |
#self_types ⇒ Object (readonly)
Returns the value of attribute self_types.
182 183 184 |
# File 'lib/rbs/ast/declarations.rb', line 182 def self_types @self_types end |
#type_params ⇒ Object (readonly)
Returns the value of attribute type_params.
178 179 180 |
# File 'lib/rbs/ast/declarations.rb', line 178 def type_params @type_params end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
195 196 197 198 199 200 201 |
# 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 |
#hash ⇒ Object
205 206 207 |
# 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) ⇒ Object
209 210 211 212 213 214 215 216 217 218 219 220 |
# 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 |