Sha256: 8c72276f14099cc2126aaf9ecf4c8fb8bfd23e4539988c5486b210ea25aa1aee

Contents?: true

Size: 577 Bytes

Versions: 55

Compression:

Stored size: 577 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

55 entries across 55 versions & 1 rubygems

Version Path
volt-0.6.5 lib/volt/extra_core/true_false.rb
volt-0.6.4 lib/volt/extra_core/true_false.rb
volt-0.6.3 lib/volt/extra_core/true_false.rb
volt-0.6.2 lib/volt/extra_core/true_false.rb
volt-0.6.1 lib/volt/extra_core/true_false.rb
volt-0.6.0 lib/volt/extra_core/true_false.rb
volt-0.5.18 lib/volt/extra_core/true_false.rb
volt-0.5.17 lib/volt/extra_core/true_false.rb
volt-0.5.16 lib/volt/extra_core/true_false.rb
volt-0.5.15 lib/volt/extra_core/true_false.rb
volt-0.5.14 lib/volt/extra_core/true_false.rb
volt-0.5.13 lib/volt/extra_core/true_false.rb
volt-0.5.12 lib/volt/extra_core/true_false.rb
volt-0.5.11 lib/volt/extra_core/true_false.rb
volt-0.5.10 lib/volt/extra_core/true_false.rb
volt-0.5.9 lib/volt/extra_core/true_false.rb
volt-0.5.8 lib/volt/extra_core/true_false.rb
volt-0.5.7 lib/volt/extra_core/true_false.rb
volt-0.5.6 lib/volt/extra_core/true_false.rb
volt-0.5.4 lib/volt/extra_core/true_false.rb