Skip to content

Feature request: description inside the block #21

@davletovalmir

Description

@davletovalmir

Hi guys,

I'm using your library and so far happy! Though would love to see a small improvement if you have bandwidth to add it.

Currently, large descriptions of complex data types (object, array, etc.) are looking ugly, since description can only be passed as an argument to object, array class methods.

object :a, description: <<~DESC.squish do
     ... some very long description here ...
     ... multiline ...
     ... etc. ...
   DESC

   string :a
end

The only clean alternative I have found so far is this, but it makes me feel that description is not part of the object schema:

description = <<~DESC.squish
  ... some very long description here ...
  ... multiline ...
  ... etc. ...
DESC

object :a, description: do
  string :a
end

What I suggest is to allow collecting the description from the inside of the block as follows:

array :a do
  description <<~DESC.squish
    ... some very long description here ...
    ... multiline ...
    ... etc. ...
  DESC

  object { integer :b }
end

Clean and neat IMO. Let me know what you think! Happy to discuss it more.

Almir

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