Class: RBS::Definition::Variable
- Inherits:
-
Object
- Object
- RBS::Definition::Variable
- Defined in:
- lib/rbs/definition.rb
Instance Attribute Summary collapse
-
#declared_in ⇒ Object
readonly
Returns the value of attribute declared_in.
-
#parent_variable ⇒ Object
readonly
Returns the value of attribute parent_variable.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(parent_variable:, type:, declared_in:) ⇒ Variable
constructor
A new instance of Variable.
- #sub(s) ⇒ Object
Constructor Details
#initialize(parent_variable:, type:, declared_in:) ⇒ Variable
Returns a new instance of Variable.
10 11 12 13 14 |
# File 'lib/rbs/definition.rb', line 10 def initialize(parent_variable:, type:, declared_in:) @parent_variable = parent_variable @type = type @declared_in = declared_in end |
Instance Attribute Details
#declared_in ⇒ Object (readonly)
Returns the value of attribute declared_in.
8 9 10 |
# File 'lib/rbs/definition.rb', line 8 def declared_in @declared_in end |
#parent_variable ⇒ Object (readonly)
Returns the value of attribute parent_variable.
6 7 8 |
# File 'lib/rbs/definition.rb', line 6 def parent_variable @parent_variable end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/rbs/definition.rb', line 7 def type @type end |
Instance Method Details
#sub(s) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rbs/definition.rb', line 16 def sub(s) self.class.new( parent_variable: parent_variable, type: type.sub(s), declared_in: declared_in ) end |