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.
220 221 222 |
# File 'lib/rbs/ast/members.rb', line 220 def annotations @annotations end |
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
222 223 224 |
# File 'lib/rbs/ast/members.rb', line 222 def comment @comment end |
#ivar_name ⇒ Object (readonly)
Returns the value of attribute ivar_name.
219 220 221 |
# File 'lib/rbs/ast/members.rb', line 219 def ivar_name @ivar_name end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
221 222 223 |
# File 'lib/rbs/ast/members.rb', line 221 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
217 218 219 |
# File 'lib/rbs/ast/members.rb', line 217 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
218 219 220 |
# File 'lib/rbs/ast/members.rb', line 218 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
233 234 235 236 237 238 |
# File 'lib/rbs/ast/members.rb', line 233 def ==(other) other.is_a?(self.class) && other.name == name && other.type == type && other.ivar_name == ivar_name end |
#hash ⇒ Object
242 243 244 |
# File 'lib/rbs/ast/members.rb', line 242 def hash self.class.hash ^ name.hash ^ type.hash ^ ivar_name.hash end |
#initialize(name:, type:, ivar_name:, annotations:, location:, comment:) ⇒ Object
224 225 226 227 228 229 230 231 |
# File 'lib/rbs/ast/members.rb', line 224 def initialize(name:, type:, ivar_name:, annotations:, location:, comment:) @name = name @type = type @ivar_name = ivar_name @annotations = annotations @location = location @comment = comment end |