Module: RBS::AST::Members::Var
- Included in:
- ClassInstanceVariable, ClassVariable, InstanceVariable
- Defined in:
- lib/rbs/ast/members.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#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:, location:, comment:) ⇒ Object
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
125 126 127 |
# File 'lib/rbs/ast/members.rb', line 125 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
124 125 126 |
# File 'lib/rbs/ast/members.rb', line 124 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
122 123 124 |
# File 'lib/rbs/ast/members.rb', line 122 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
123 124 125 |
# File 'lib/rbs/ast/members.rb', line 123 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
134 135 136 |
# File 'lib/rbs/ast/members.rb', line 134 def ==(other) other.is_a?(self.class) && other.name == name && other.type == type end |
#hash ⇒ Object
140 141 142 |
# File 'lib/rbs/ast/members.rb', line 140 def hash name.hash ^ type.hash end |
#initialize(name:, type:, location:, comment:) ⇒ Object
127 128 129 130 131 132 |
# File 'lib/rbs/ast/members.rb', line 127 def initialize(name:, type:, location:, comment:) @name = name @type = type @location = location @comment = comment end |