Sha256: c6e23547a510448644e2aa04293749d3da3cb427c73d82e98ca46764fa830f61

Contents?: true

Size: 869 Bytes

Versions: 3

Compression:

Stored size: 869 Bytes

Contents

module YARD::MRuby::Templates
  module Helpers
    # Helper methods for text template formats.
    module HTMLHelper

      def fsignature(func, link = true, show_extras = true)
        name = func.name
        prefix = func.return_type || 'void'
        params = if func.parameter_types.empty?
                    'void'
                  else
                    func.parameter_types.map do |t|
                      if show_extras
                        [t.type, t.name].join(' ')
                      else
                        t.type
                      end
                    end.join(', ')
                  end
        title = "%s <strong>%s</strong>(%s)" % [h(prefix), h(name), h(params)]

        if link
          url = url_for(func)
          link_url(url, title, :title => name)
        else
          title
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yard-mruby-0.2.2 lib/yard/mruby/templates/helpers/html_helper.rb
yard-mruby-0.2.1 lib/yard/mruby/templates/helpers/html_helper.rb
yard-mruby-0.2.0 lib/yard/mruby/templates/helpers/html_helper.rb