Class: RBS::Constant
- Inherits:
-
Object
- Object
- RBS::Constant
- Defined in:
- lib/rbs/constant.rb
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
-
#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:, entry:) ⇒ Constant
constructor
A new instance of Constant.
Constructor Details
#initialize(name:, type:, entry:) ⇒ Constant
Returns a new instance of Constant.
9 10 11 12 13 |
# File 'lib/rbs/constant.rb', line 9 def initialize(name:, type:, entry:) @name = name @type = type @entry = entry end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
7 8 9 |
# File 'lib/rbs/constant.rb', line 7 def entry @entry end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/rbs/constant.rb', line 5 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/rbs/constant.rb', line 6 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
15 16 17 18 19 20 |
# File 'lib/rbs/constant.rb', line 15 def ==(other) other.is_a?(Constant) && other.name == name && other.type == type && other.entry == entry end |
#hash ⇒ Object
24 25 26 |
# File 'lib/rbs/constant.rb', line 24 def hash self.class.hash ^ name.hash ^ type.hash ^ entry.hash end |