Sha256: 2df116f6e424ac4ad534e8b61ca760a3c32e3c3ec8d1faf0cf0f85799e865921

Contents?: true

Size: 1.59 KB

Versions: 35

Compression:

Stored size: 1.59 KB

Contents

class SkrMetaMethodHandler < YARD::Handlers::Ruby::MethodHandler

    def process
        if group_name
            namespace.groups << group_name unless namespace.groups.include? group_name
        end
    end

    def get_namespace( path )
        ensure_loaded! P( path )
        P( path )
    end

    def get_method( ns )
    end

    def add_to_overview
        ns = get_namespace( concern_path + "::ClassMethods" )
        method = ns.meths.detect{ |nsmethod|  nsmethod.name == method_name }

        namespace.docstring += "\n\n" +
                               "## #{method_title} {#{ns} >>}\n\n" +
                               method.docstring.dup

        method.docstring.tags.each{ |tag|  namespace.docstring.add_tag tag }
    end

    def add_instance_methods
        ns = get_namespace( concern_path + "::InstanceMethods" )
        ns.meths.each do |nsmethod|
            object = YARD::CodeObjects::MethodObject.new(namespace, nsmethod.name )
            object.scope = :instance
            object.explicit = false

            object.docstring = nsmethod.docstring.dup
            register object
        end
    end

    def add_class_methods
        ns = get_namespace( concern_path + "::MixedInClassMethods" )

        ns.meths.each do |nsmethod|
            object = YARD::CodeObjects::MethodObject.new(namespace, nsmethod.name )
            object.scope = :instance
            object.explicit = false

            object.docstring = nsmethod.docstring.dup
            register object
        end
    end

    def method_title
        method_name.to_s.titleize
    end

    def group_name
    end

end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
hippo-fw-0.9.9 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.8 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.7 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.6 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.5 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.4 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.3 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.2 yard_ext/concern_meta_methods.rb
hippo-fw-0.9.1 yard_ext/concern_meta_methods.rb
lanes-0.8.3 yard_ext/concern_meta_methods.rb
lanes-0.8.2 yard_ext/concern_meta_methods.rb
lanes-0.8.1 yard_ext/concern_meta_methods.rb
lanes-0.8.0 yard_ext/concern_meta_methods.rb
lanes-0.7.0 yard_ext/concern_meta_methods.rb
lanes-0.6.1 yard_ext/concern_meta_methods.rb
lanes-0.6.0 yard_ext/concern_meta_methods.rb
lanes-0.5.6 yard_ext/concern_meta_methods.rb
lanes-0.5.5 yard_ext/concern_meta_methods.rb
lanes-0.5.0 yard_ext/concern_meta_methods.rb
lanes-0.4.0 yard_ext/concern_meta_methods.rb