Class: RBS::AST::Declarations::Module
- Inherits:
-
Object
- Object
- RBS::AST::Declarations::Module
- Defined in:
- lib/rbs/ast/declarations.rb
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_type ⇒ Object
readonly
Returns the value of attribute self_type.
-
#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_type:, annotations:, location:, comment:) ⇒ Module
constructor
A new instance of Module.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(name:, type_params:, members:, self_type:, annotations:, location:, comment:) ⇒ Module
Returns a new instance of Module.
163 164 165 166 167 168 169 170 171 |
# File 'lib/rbs/ast/declarations.rb', line 163 def initialize(name:, type_params:, members:, self_type:, annotations:, location:, comment:) @name = name @type_params = type_params @self_type = self_type @members = members @annotations = annotations @location = location @comment = comment end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
159 160 161 |
# File 'lib/rbs/ast/declarations.rb', line 159 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
161 162 163 |
# File 'lib/rbs/ast/declarations.rb', line 161 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
158 159 160 |
# File 'lib/rbs/ast/declarations.rb', line 158 def location @location end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
157 158 159 |
# File 'lib/rbs/ast/declarations.rb', line 157 def members @members end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
155 156 157 |
# File 'lib/rbs/ast/declarations.rb', line 155 def name @name end |
#self_type ⇒ Object (readonly)
Returns the value of attribute self_type.
160 161 162 |
# File 'lib/rbs/ast/declarations.rb', line 160 def self_type @self_type end |
#type_params ⇒ Object (readonly)
Returns the value of attribute type_params.
156 157 158 |
# File 'lib/rbs/ast/declarations.rb', line 156 def type_params @type_params end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
173 174 175 176 177 178 179 |
# File 'lib/rbs/ast/declarations.rb', line 173 def ==(other) other.is_a?(Module) && other.name == name && other.type_params == type_params && other.self_type == self_type && other.members == members end |
#hash ⇒ Object
183 184 185 |
# File 'lib/rbs/ast/declarations.rb', line 183 def hash self.class.hash ^ name.hash ^ type_params.hash ^ self_type.hash ^ members.hash end |
#to_json(*a) ⇒ Object
187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/rbs/ast/declarations.rb', line 187 def to_json(*a) { declaration: :module, name: name, type_params: type_params, members: members, self_type: self_type, annotations: annotations, location: location, comment: comment }.to_json(*a) end |