Class: Yoda::Model::Environment::ValueResolveContext::WrappedType

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/yoda/model/environment/value_resolve_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, context:) ⇒ WrappedType

Returns a new instance of WrappedType.

Parameters:



31
32
33
34
# File 'lib/yoda/model/environment/value_resolve_context.rb', line 31

def initialize(type, context:)
  @context = context
  super(type)
end

Instance Attribute Details

#contextValueResolveContext (readonly)

Returns:



27
28
29
# File 'lib/yoda/model/environment/value_resolve_context.rb', line 27

def context
  @context
end

Instance Method Details

#act_as_type_wrapper?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/yoda/model/environment/value_resolve_context.rb', line 36

def act_as_type_wrapper?
  wrapped_type
end

#pretty_print(pp) ⇒ Object

Parameters:

  • pp (PP)


51
52
53
54
55
56
57
# File 'lib/yoda/model/environment/value_resolve_context.rb', line 51

def pretty_print(pp)
  pp.object_group(self) do
    pp.breakable
    pp.text "type:"
    pp.pp wrapped_type
  end
end

#propage_context_to(another_type) ⇒ WrappedType

Returns:



41
42
43
# File 'lib/yoda/model/environment/value_resolve_context.rb', line 41

def propage_context_to(another_type)
  context.wrap(another_type)
end

#wrapped_typeObject

Parameters:

  • type (RBS::Types::t)


46
47
48
# File 'lib/yoda/model/environment/value_resolve_context.rb', line 46

def wrapped_type
  __getobj__
end