Skip to content

Struct subclasses using block form do not get treated like structs #1479

Closed
@bdewater

Description

@bdewater

Steps to reproduce

Came up as part of lostisland/faraday#1489 - in short:

  • A subclass of Struct is defined: class Options < Struct; end
  • Currently class Env < Options; end is documented as: https://www.rubydoc.info/gems/faraday/Faraday/Env
  • Change to Env = Options.new { } as recommended by the Ruby docs results in the Env code being shown inline.

Actual Output

http://localhost:8808/docs/Faraday looks like:
Screenshot 2023-02-01 at 5 44 59 PM

Expected Output

Same treatment as Env = Struct.new { } which results in a separate page.

Environment details:

  • OS: macOS 13.1
  • Ruby version (ruby -v): ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]
  • YARD version (yard -v): yard 0.9.28

I have read the Contributing Guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions