Sha256: e419a747017e4ad9838c7e91be56553b4e6080b06bac4fc45a5be92a96d263d4

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

{
  "schema_type": "object",
  "ree_version": "1.0.1",
  "name": "truncate_words",
  "path": "packages/ree_string/package/ree_string/functions/truncate_words.rb",
  "mount_as": "fn",
  "class": "ReeString::TruncateWords",
  "factory": null,
  "methods": [
    {
      "doc": "Truncates a given +text+ after a given number of words (<tt>words_count</tt>):\n\n  truncate_words('Once upon a time in a world far far away', 4)\n  # => \"Once upon a time...\"\n\nPass a string or regexp <tt>:separator</tt> to specify a different separator of words:\n\n  truncate_words('Once<br>upon<br>a<br>time<br>in<br>a<br>world', 5, separator: '<br>')\n  # => \"Once<br>upon<br>a<br>time<br>in...\"\n\nThe last characters will be replaced with the <tt>:omission</tt> string (defaults to \"...\"):\n\n  truncate_words('And they found that many people were sleeping better.', 5, omission: '... (continued)')\n  # => \"And they found that many... (continued)\"",
      "throws": [

      ],
      "return": "String",
      "args": [
        {
          "arg": "str",
          "type": "String"
        },
        {
          "arg": "words_count",
          "type": "Integer"
        },
        {
          "arg": "opts",
          "type": "Ksplat[:omission? => String, :separator? => Or[String, Regexp]]"
        }
      ]
    }
  ],
  "links": [

  ]
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ree_lib-1.0.3 lib/ree_lib/packages/ree_string/schemas/ree_string/functions/truncate_words.schema.json
ree_lib-1.0.2 lib/ree_lib/packages/ree_string/schemas/ree_string/functions/truncate_words.schema.json
ree_lib-1.0.1 lib/ree_lib/packages/ree_string/schemas/ree_string/functions/truncate_words.schema.json
ree_lib-1.0.0 lib/ree_lib/packages/ree_string/schemas/ree_string/functions/truncate_words.schema.json