123456789_123456789_123456789_123456789_123456789_

Class: RBS::Definition::Variable

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/definition.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(parent_variable:, type:, declared_in:) ⇒ Variable

[ GitHub ]

  
# 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 (readonly)

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 6

attr_reader :declared_in

#parent_variable (readonly)

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 4

attr_reader :parent_variable

#type (readonly)

[ GitHub ]

  
# File 'lib/rbs/definition.rb', line 5

attr_reader :type

Instance Method Details

#sub(s)

[ GitHub ]

  
# 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