Class: Loxxy::Datatype::Boolean

Inherits:
BuiltinDatatype show all
Defined in:
lib/loxxy/datatype/boolean.rb

Overview

Abstract class that generalizes a Lox boolean value. An instance acts merely as a wrapper around a Ruby representation of the value.

Direct Known Subclasses

False, True

Instance Attribute Summary

Attributes inherited from BuiltinDatatype

#value

Instance Method Summary collapse

Methods inherited from BuiltinDatatype

#!, #!=, #accept, #and, #falsey?, #initialize, #or, #to_str, #truthy?

Constructor Details

This class inherits a constructor from Loxxy::Datatype::BuiltinDatatype

Instance Method Details

#false?FalseClass, TrueClass

Is this object representing a false value in Lox?

Returns:

  • (FalseClass, TrueClass)


13
14
15
# File 'lib/loxxy/datatype/boolean.rb', line 13

def false?
  false
end

#true?FalseClass, TrueClass

Is this object representing the true value in Lox?

Returns:

  • (FalseClass, TrueClass)


19
20
21
# File 'lib/loxxy/datatype/boolean.rb', line 19

def true?
  false
end