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.
81 82 83 |
# File 'lib/rbs/ast/members.rb', line 81 def comment @comment end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
80 81 82 |
# File 'lib/rbs/ast/members.rb', line 80 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
78 79 80 |
# File 'lib/rbs/ast/members.rb', line 78 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
79 80 81 |
# File 'lib/rbs/ast/members.rb', line 79 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
90 91 92 |
# File 'lib/rbs/ast/members.rb', line 90 def ==(other) other.is_a?(self.class) && other.name == name && other.type == type end |
#hash ⇒ Object
96 97 98 |
# File 'lib/rbs/ast/members.rb', line 96 def hash self.class.hash ^ name.hash ^ type.hash end |
#initialize(name:, type:, location:, comment:) ⇒ Object
83 84 85 86 87 88 |
# File 'lib/rbs/ast/members.rb', line 83 def initialize(name:, type:, location:, comment:) @name = name @type = type @location = location @comment = comment end |