Sha256: 35571b8897b25a4e9c742a5714e80c0cd42a5db5667c43f11fe077b7029ddf9c
Contents?: true
Size: 573 Bytes
Versions: 6
Compression:
Stored size: 573 Bytes
Contents
module YARD module Generators class ConstructorGenerator < Base before_generate :has_constructor? def sections_for(object) [:header, [G(MethodGenerator)]] end protected def has_constructor? constructor_method ? true : false end def constructor_method current_object.meths.find {|o| o.name == :initialize && o.scope == :instance } end def constructor_method_inherited? constructor_method.namespace != current_object end end end end
Version data entries
6 entries across 6 versions & 1 rubygems