Sha256: 1efd1742e103ef93fb82f53e9a0295cc98200db19ce5b7f1170b1729ffce99a0

Contents?: true

Size: 1.48 KB

Versions: 28

Compression:

Stored size: 1.48 KB

Contents

{
  "schema_type": "object",
  "schema_version": "1.0",
  "name": "word_wrap",
  "path": "packages/ree_text/package/ree_text/functions/word_wrap.rb",
  "mount_as": "fn",
  "class": "ReeText::WordWrap",
  "factory": null,
  "methods": [
    {
      "doc": "Wraps the +text+ into lines no longer than +line_width+ width. This method\nbreaks on the first whitespace character that does not exceed +line_width+\n(which is 80 by default).\n\n  word_wrap('Once upon a time')\n  # => Once upon a time\n\n  word_wrap('Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding a successor to the throne turned out to be more trouble than anyone could have imagined...')\n  # => Once upon a time, in a kingdom called Far Far Away, a king fell ill, and finding\na successor to the throne turned out to be more trouble than anyone could have\nimagined...\n\n  word_wrap('Once upon a time', line_width: 8)\n  # => Once\nupon a\ntime\n\n  word_wrap('Once upon a time', line_width: 1)\n  # => Once\nupon\na\ntime\n\n  You can also specify a custom +break_sequence+ (\"\n\" by default)\n\n  word_wrap('Once upon a time', line_width: 1, break_sequence: \"\r\n\")\n  # => Once\r\nupon\r\na\r\ntime",
      "throws": [

      ],
      "return": "String",
      "args": [
        {
          "arg": "text",
          "type": "String"
        },
        {
          "arg": "opts",
          "type": "Ksplat[:line_width? => Integer, :break_sequence? => String]"
        }
      ]
    }
  ],
  "links": [

  ]
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ree_lib-1.0.32 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.31 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.30 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.29 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.28 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.27 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.26 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.24 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.23 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.22 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.21 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.20 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.19 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.18 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.17 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.16 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.15 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.14 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.13 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json
ree_lib-1.0.12 lib/ree_lib/packages/ree_text/schemas/ree_text/functions/word_wrap.schema.json