Sha256: 3cd2946ea872bd9075abc2b70ae2e44431ae4f6183b081e618cdcf54ffc224ed

Contents?: true

Size: 568 Bytes

Versions: 58

Compression:

Stored size: 568 Bytes

Contents

# The true?/false? predicates are convience methods since if ..reactive_value.. does
# not correctly evaluate.  The reason for this is that ruby currently does not allow
# anything besides nil and false to be falsy.

class Object
  def true?
    true
  end

  def false?
    false
  end
end

class FalseClass
  def true?
    false
  end

  def false?
    true
  end
end

class NilClass
  def true?
    false
  end

  def false?
    true
  end
end

# Opal only has a single class for true/false
class Boolean
  def true?
    self
  end

  def false?
    self
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
volt-0.8.27.beta7 lib/volt/extra_core/true_false.rb
volt-0.8.27.beta6 lib/volt/extra_core/true_false.rb
volt-0.8.27.beta5 lib/volt/extra_core/true_false.rb
volt-0.8.27.beta4 lib/volt/extra_core/true_false.rb
volt-0.8.27.beta3 lib/volt/extra_core/true_false.rb
volt-0.8.27.beta2 lib/volt/extra_core/true_false.rb
volt-0.8.27.beta1 lib/volt/extra_core/true_false.rb
volt-0.8.26.beta1 lib/volt/extra_core/true_false.rb
volt-0.8.26 lib/volt/extra_core/true_false.rb
volt-0.8.24 lib/volt/extra_core/true_false.rb
volt-0.8.23 lib/volt/extra_core/true_false.rb
volt-0.8.22 lib/volt/extra_core/true_false.rb
volt-0.8.22.beta2 lib/volt/extra_core/true_false.rb
volt-0.8.22.beta1 lib/volt/extra_core/true_false.rb
volt-0.8.21 lib/volt/extra_core/true_false.rb
volt-0.8.20 lib/volt/extra_core/true_false.rb
volt-0.8.19 lib/volt/extra_core/true_false.rb
volt-0.8.18 lib/volt/extra_core/true_false.rb
volt-0.8.17 lib/volt/extra_core/true_false.rb
volt-0.8.16 lib/volt/extra_core/true_false.rb