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.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(parent_variable:, type:, declared_in:, source:) ⇒ Variable
constructor
A new instance of Variable.
- #sub(s) ⇒ Object
Constructor Details
#initialize(parent_variable:, type:, declared_in:, source:) ⇒ Variable
Returns a new instance of Variable.
11 12 13 14 15 16 |
# File 'lib/rbs/definition.rb', line 11 def initialize(parent_variable:, type:, declared_in:, source:) @parent_variable = parent_variable @type = type @declared_in = declared_in @source = source 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 |
#source ⇒ Object (readonly)
Returns the value of attribute source.
9 10 11 |
# File 'lib/rbs/definition.rb', line 9 def source @source 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
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rbs/definition.rb', line 18 def sub(s) return self if s.empty? self.class.new( parent_variable: parent_variable, type: type.sub(s), declared_in: declared_in, source: source ) end |