Class: Steep::Interface::IvarChain
- Inherits:
-
Object
- Object
- Steep::Interface::IvarChain
- Defined in:
- lib/steep/interface/ivar_chain.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type:, parent: nil) ⇒ IvarChain
constructor
A new instance of IvarChain.
- #subst(s) ⇒ Object
Constructor Details
#initialize(type:, parent: nil) ⇒ IvarChain
Returns a new instance of IvarChain.
7 8 9 10 |
# File 'lib/steep/interface/ivar_chain.rb', line 7 def initialize(type:, parent: nil) @type = type @parent = parent end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
5 6 7 |
# File 'lib/steep/interface/ivar_chain.rb', line 5 def parent @parent end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/steep/interface/ivar_chain.rb', line 4 def type @type end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 15 16 |
# File 'lib/steep/interface/ivar_chain.rb', line 12 def ==(other) other.is_a?(IvarChain) && type == type && parent == parent end |
#subst(s) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/steep/interface/ivar_chain.rb', line 18 def subst(s) self.class.new( type: type.subst(s), parent: parent&.subst(s) ) end |