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