Sha256: 77d0a3a1f302e1e48f8339b632a10d93855f05dafbd65422348fa0c4d1c378bc
Contents?: true
Size: 490 Bytes
Versions: 3
Compression:
Stored size: 490 Bytes
Contents
class Symbol def not? self.to_s.slice(0,1) == '~' end def ~@ if self.to_s.slice(0,1) == '~' :"#{self.to_s[1..-1]}" else :"~#{self}" end end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCSymbol < Test::Unit::TestCase def test_not assert_equal( :"~a", ~:a ) a = :a n = ~a assert( n.not? ) end end =end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
facets-0.9.0 | lib/nano/symbol/not.rb |
facets-1.0.0 | lib/facet/symbol/not.rb |
facets-1.0.3 | packages/core/lib/facet/symbol/not.rb |