Class: RBS::Definition::Variable
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/definition.rb |
Class Method Summary
Instance Attribute Summary
- #declared_in readonly
- #parent_variable readonly
- #source readonly
- #type readonly
Instance Method Summary
Constructor Details
.new(parent_variable:, type:, declared_in:, source:) ⇒ Variable
# 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 (readonly)
[ GitHub ]# File 'lib/rbs/definition.rb', line 8
attr_reader :declared_in
#parent_variable (readonly)
[ GitHub ]# File 'lib/rbs/definition.rb', line 6
attr_reader :parent_variable
#source (readonly)
[ GitHub ]# File 'lib/rbs/definition.rb', line 9
attr_reader :source
#type (readonly)
[ GitHub ]# File 'lib/rbs/definition.rb', line 7
attr_reader :type
Instance Method Details
#sub(s)
[ GitHub ]# 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