Class: Axiom::Attribute::Boolean

Inherits:
Object show all
Includes:
Function::Connective::Conjunction::Methods, Function::Connective::Disjunction::Methods, Function::Connective::Negation::Methods
Defined in:
lib/axiom/attribute/boolean.rb

Overview

Represents a Boolean value in a relation tuple

Instance Attribute Summary

Attributes inherited from Axiom::Attribute

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Function::Connective::Conjunction::Methods

#and

Methods included from Axiom::Aliasable

#inheritable_alias

Methods included from Function::Connective::Disjunction::Methods

#or

Methods included from Function::Connective::Negation::Methods

#not

Methods included from Function::Predicate::Equality::Methods

#eq

Methods included from Function::Predicate::Exclusion::Methods

#exclude

Methods included from Function::Predicate::Inequality::Methods

#ne

Methods included from Function::Predicate::Inclusion::Methods

#include

Methods included from Axiom::Aggregate::Count::Methods

#count

Methods inherited from Axiom::Attribute

#call, coerce, infer_type, #initialize, name_from, #rename, #required?, #type, #valid_primitive?

Methods included from Visitable

#accept

Constructor Details

This class inherits a constructor from Axiom::Attribute

Class Method Details

.primitiveClass<TrueClass>

The Boolean primitive

Examples:

Boolean.primitive  # => TrueClass

Returns:



20
21
22
# File 'lib/axiom/attribute/boolean.rb', line 20

def self.primitive
  TrueClass
end

Instance Method Details

#valid_value?(value) ⇒ Boolean

Test if the value is a boolean

Examples:

boolean.valid_value?(value)  # => true or false

Parameters:

  • value (Object)

    the value to test

Returns:



35
36
37
# File 'lib/axiom/attribute/boolean.rb', line 35

def valid_value?(value)
  valid_or_optional?(value) { super || value.kind_of?(FalseClass) }
end