Sha256: b3d00233fb64c0522949d43636e3c062ec93a161ce5be307f86dc66f5279b1ec

Contents?: true

Size: 589 Bytes

Versions: 140

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

# :nocov:
module Primer
  module Yard
    # YARD Handler to parse `renders_one` calls.
    class RendersOneHandler < ::YARD::Handlers::Ruby::Base
      handles method_call(:renders_one)
      namespace_only

      process do
        name = statement.parameters.first.jump(:tstring_content, :ident).source
        object = ::YARD::CodeObjects::MethodObject.new(namespace, name)
        register(object)
        parse_block(statement.last, owner: object)

        object.dynamic = true
        object[:renders_one] = true
      end
    end
  end
end
# :nocov:

Version data entries

140 entries across 140 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.48.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.47.1 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.47.0 lib/primer/yard/renders_one_handler.rb
primer_view_components-0.34.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.46.1 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.46.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.45.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.44.3 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.44.2 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.44.1 lib/primer/yard/renders_one_handler.rb
primer_view_components-0.33.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.44.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.43.1 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.43.0 lib/primer/yard/renders_one_handler.rb
primer_view_components-0.32.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.42.0 lib/primer/yard/renders_one_handler.rb
primer_view_components-0.31.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.41.1 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.41.0 lib/primer/yard/renders_one_handler.rb
openproject-primer_view_components-0.40.0 lib/primer/yard/renders_one_handler.rb