Sha256: 1fc36b92b15ed23ccf1728fe5689beaf602efb013dc87fcced9f65821e840b80

Contents?: true

Size: 676 Bytes

Versions: 7

Compression:

Stored size: 676 Bytes

Contents

== Comparable#clip

  require 'facets/comparable/clip'

single argument

  3.clip(4).assert == 4
  4.clip(4).assert == 4
  5.clip(4).assert == 5

two arguments

  4.clip(3,5).assert == 4
  3.clip(3,5).assert == 3
  5.clip(3,5).assert == 5
  2.clip(3,5).assert == 3
  6.clip(3,5).assert == 5

on strings

  'd'.clip('c','e').assert == 'd'
  'c'.clip('c','e').assert == 'c'
  'e'.clip('c','e').assert == 'e'
  'b'.clip('c','e').assert == 'c'
  'f'.clip('c','e').assert == 'e'

== Comparable#bound

The bound method is an alias for #clip. It is actually
the original name of this method.

  3.bound(4).assert == 4

  4.bound(3,5).assert == 4

  'd'.bound('c','e').assert == 'd'

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
facets-3.0.0 demo/core/comparable/clip.rdoc
facets-2.9.3 qed/core/comparable/clip.rdoc
facets-2.9.2 qed/core/comparable/clip.rdoc
facets-2.9.1 qed/core/comparable/clip.rdoc
facets-2.9.0 qed/core/comparable/clip.rdoc
facets-2.9.0.pre.2 qed/core/comparable/clip.rdoc
facets-2.9.0.pre.1 qed/core/comparable/clip.rdoc