@@ -26,11 +26,15 @@ def process_mixin(mixin)
26
26
raise YARD ::Parser ::UndocumentableError unless mixin . ref?
27
27
raise YARD ::Parser ::UndocumentableError if mixin . first . type == :ident
28
28
29
- case obj = Proxy . new ( namespace , mixin . source )
30
- when ConstantObject # If a constant is included, use its value as the real object
31
- obj = Proxy . new ( namespace , obj . value , :module )
29
+ if mixin . type == :var_ref && mixin [ 0 ] == s ( :kw , "self" )
30
+ obj = namespace
32
31
else
33
- obj = Proxy . new ( namespace , mixin . source , :module )
32
+ case obj = Proxy . new ( namespace , mixin . source )
33
+ when ConstantObject # If a constant is included, use its value as the real object
34
+ obj = Proxy . new ( namespace , obj . value , :module )
35
+ else
36
+ obj = Proxy . new ( namespace , mixin . source , :module )
37
+ end
34
38
end
35
39
36
40
rec = recipient ( mixin )
@@ -41,7 +45,7 @@ def process_mixin(mixin)
41
45
end
42
46
43
47
def recipient ( mixin )
44
- if statement [ 0 ] . type == :const_path_ref
48
+ if statement [ 0 ] . type == :const_path_ref || statement [ 0 ] . type == :top_const_ref
45
49
Proxy . new ( namespace , statement [ 0 ] . source )
46
50
elsif statement [ 0 ] . type == :var_ref && statement [ 0 ] [ 0 ] != s ( :kw , "self" )
47
51
statement [ 0 ] [ 0 ] . type == :const ?
0 commit comments