Sha256: 45c10d1e1f61739dccd1b35f5cd7ee2333f93adf572c019e071f884c99c8991e

Contents?: true

Size: 326 Bytes

Versions: 15

Compression:

Stored size: 326 Bytes

Contents

module Comparable
  def <(other)
    (self <=> other) == -1
  end

  def <=(other)
    (self <=> other) <= 0
  end

  def ==(other)
    (self <=> other) == 0
  end

  def >(other)
    (self <=> other) == 1
  end

  def >=(other)
    (self <=> other) >= 0
  end

  def between?(min, max)
    self > min && self < max
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
opal-0.4.4 corelib/comparable.rb
opal-0.4.3 corelib/opal/comparable.rb
opal-0.4.2 opal/opal/comparable.rb
opal-0.4.1 opal/opal/comparable.rb
opal-0.4.0 opal/opal/comparable.rb
opal-0.3.44 opal/opal/comparable.rb
opal-0.3.43 opal/opal/comparable.rb
opal-0.3.42 opal/opal/comparable.rb
opal-0.3.41 opal/opal/comparable.rb
opal-0.3.40 lib/assets/javascripts/opal/comparable.rb
opal-0.3.39 lib/assets/javascripts/opal/comparable.rb
opal-0.3.38 lib/assets/javascripts/opal/comparable.rb
opal-0.3.19 core/comparable.rb
opal-0.3.18 core/comparable.rb
opal-0.3.17 core/comparable.rb