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.
-
#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.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
- #initialize(name:, type:, ivar_name:, annotations:, location:, comment:) ⇒ Object
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
201 202 203 |
# File 'lib/rbs/ast/members.rb', line 201 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
203 204 205 |
# File 'lib/rbs/ast/members.rb', line 203 def comment @comment end |
#ivar_name ⇒ Object (readonly)
Returns the value of attribute ivar_name.
200 201 202 |
# File 'lib/rbs/ast/members.rb', line 200 def ivar_name @ivar_name end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
202 203 204 |
# File 'lib/rbs/ast/members.rb', line 202 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
198 199 200 |
# File 'lib/rbs/ast/members.rb', line 198 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
199 200 201 |
# File 'lib/rbs/ast/members.rb', line 199 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
214 215 216 217 218 219 |
# File 'lib/rbs/ast/members.rb', line 214 def ==(other) other.is_a?(self.class) && other.name == name && other.type == type && other.ivar_name == ivar_name end |
#hash ⇒ Object
223 224 225 |
# File 'lib/rbs/ast/members.rb', line 223 def hash self.class.hash ^ name.hash ^ type.hash ^ ivar_name.hash end |
#initialize(name:, type:, ivar_name:, annotations:, location:, comment:) ⇒ Object
205 206 207 208 209 210 211 212 |
# File 'lib/rbs/ast/members.rb', line 205 def initialize(name:, type:, ivar_name:, annotations:, location:, comment:) @name = name @type = type @ivar_name = ivar_name @annotations = annotations @location = location @comment = comment end |