Socket
Book a DemoInstallSign in
Socket

visfleet-ternary_logic

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

visfleet-ternary_logic

1.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

= ternary_logic

This library implements Ternary Logic for Ruby. Ternary logic (also known as 3-value-logic) adds the value "Unknown" to the two traditional (i.e. boolean) logic values, True and False. This is useful for adding a bit of fuzzyness into your logic.

To install:

sudo gem install visfleet-ternary_logic

To use:

require 'ternary_logic'

You now have the additional constant, UNKNOWN, to use alongside the constants true and false.

state = UNKNOWN if state == UNKNWON puts "Don't know?" end

You can use the logical operators "|" and "&" to compare UNKNOWN with true and false values.

state = (true | UNKNOWN) state = (UNKNOWN & true)

Ternary logic uses the following truth table:

UNKNOWN & true == UNKNOWN UNKNOWN & false == false UNKNOWN & UNKNOWN == UNKNOWN

UNKNOWN | true == true UNKNOWN | false == UNKNOWN UNKNOWN | UNKNOWN == UNKNOWN

== Copyright

Copyright (c) 2009 VisFleet. See LICENSE for details.

FAQs

Package last updated on 10 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.