Module: Rtype::MethodAnnotator::ClassMethods

Defined in:
lib/rtype/method_annotator.rb

Instance Method Summary collapse

Instance Method Details

#method_added(name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/rtype/method_annotator.rb', line 8

def method_added(name)
  if @_rtype_proxy
    proxy = _rtype_proxy
    if proxy.annotation_mode
      ::Rtype::define_typed_method(self, name, proxy.annotation_type_sig)
      proxy.annotation_mode = false
      proxy.annotation_type_sig = nil
    end
  end
end

#singleton_method_added(name) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/rtype/method_annotator.rb', line 19

def singleton_method_added(name)
  if @_rtype_proxy
    proxy = _rtype_proxy
    if proxy.annotation_mode
      ::Rtype::define_typed_method(singleton_class, name, proxy.annotation_type_sig)
      proxy.annotation_mode = false
      proxy.annotation_type_sig = nil
    end
  end
end