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.
8 9 10 11 12 |
# File 'lib/rbs/definition.rb', line 8 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.
6 7 8 |
# File 'lib/rbs/definition.rb', line 6 def declared_in @declared_in end |
#parent_variable ⇒ Object (readonly)
Returns the value of attribute parent_variable.
4 5 6 |
# File 'lib/rbs/definition.rb', line 4 def parent_variable @parent_variable end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/rbs/definition.rb', line 5 def type @type end |
Instance Method Details
#sub(s) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rbs/definition.rb', line 14 def sub(s) self.class.new( parent_variable: parent_variable, type: type.sub(s), declared_in: declared_in ) end |