Sha256: 5c27f0d68a07d5f45d94c77ab7f7e2498979e3a675eb70e66468cc63fa48f5bd

Contents?: true

Size: 1.18 KB

Versions: 35

Compression:

Stored size: 1.18 KB

Contents

class VisibleIdHandler < SkrMetaMethodHandler

    namespace_only
    handles method_call(:has_visible_id)

    def process
        super
        add_to_overview
        add_instance_methods

        # we have to do this since our attribute ends in _id and yard-activerecord
        # won't index it
        object = YARD::CodeObjects::MethodObject.new(namespace, "visible_id" )
        object.scope = :instance
        object.explicit = false
        object.docstring.add_tag YARD::Tags::Tag.new(:return, '', 'Integer' )
        register object
        namespace.instance_attributes[:visible_id] = { read: object }

        object = YARD::CodeObjects::MethodObject.new(namespace, 'with_visible_id', :class)
        object.docstring = "Query the visible_id as a string.  " +
                           "Will use an sql like operator if a '%' is present, " +
                           "and equality match otherwise."
        object.docstring.add_tag YARD::Tags::Tag.new(:return, '', [ "Array<#{namespace}>" ] )

    end

    def concern_path
        "Skr::Concerns::VisibleIdIdentifier"
    end

    def method_name
        :has_visible_id
    end
    def method_title
        'Has Visible ID'
    end
end

Version data entries

35 entries across 35 versions & 3 rubygems

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