Module: RBS::AST::Members::Attribute
- Included in:
- AttrAccessor, AttrReader, AttrWriter
- Defined in:
- lib/rbs/ast/members.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#ivar_name ⇒ Object
readonly
Returns the value of attribute ivar_name.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
- #initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: nil) ⇒ Object
- #update(name: self.name, type: self.type, ivar_name: self.ivar_name, kind: self.kind, annotations: self.annotations, location: self.location, comment: self.comment, visibility: self.visibility) ⇒ Object
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
263 264 265 |
# File 'lib/rbs/ast/members.rb', line 263 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
265 266 267 |
# File 'lib/rbs/ast/members.rb', line 265 def comment @comment end |
#ivar_name ⇒ Object (readonly)
Returns the value of attribute ivar_name.
262 263 264 |
# File 'lib/rbs/ast/members.rb', line 262 def ivar_name @ivar_name end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
261 262 263 |
# File 'lib/rbs/ast/members.rb', line 261 def kind @kind end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
264 265 266 |
# File 'lib/rbs/ast/members.rb', line 264 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
259 260 261 |
# File 'lib/rbs/ast/members.rb', line 259 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
260 261 262 |
# File 'lib/rbs/ast/members.rb', line 260 def type @type end |
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
266 267 268 |
# File 'lib/rbs/ast/members.rb', line 266 def visibility @visibility end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
279 280 281 282 283 284 285 286 |
# File 'lib/rbs/ast/members.rb', line 279 def ==(other) other.is_a?(self.class) && other.name == name && other.type == type && other.ivar_name == ivar_name && other.kind == kind && other.visibility == visibility end |
#hash ⇒ Object
290 291 292 |
# File 'lib/rbs/ast/members.rb', line 290 def hash name.hash ^ type.hash ^ ivar_name.hash ^ kind.hash ^ visibility.hash end |
#initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: nil) ⇒ Object
268 269 270 271 272 273 274 275 276 277 |
# File 'lib/rbs/ast/members.rb', line 268 def initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: nil) @name = name @type = type @ivar_name = ivar_name @annotations = annotations @location = location @comment = comment @kind = kind @visibility = visibility end |
#update(name: self.name, type: self.type, ivar_name: self.ivar_name, kind: self.kind, annotations: self.annotations, location: self.location, comment: self.comment, visibility: self.visibility) ⇒ Object
294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/rbs/ast/members.rb', line 294 def update(name: self.name, type: self.type, ivar_name: self.ivar_name, kind: self.kind, annotations: self.annotations, location: self.location, comment: self.comment, visibility: self.visibility) klass = _ = self.class klass.new( name: name, type: type, ivar_name: ivar_name, kind: kind, annotations: annotations, location: location, comment: comment, visibility: visibility ) end |