Files
dolt/types/bool.go
T
Mike Gray 54e4c18806 primitives.go split into bool.go and number.go (#1503)
* primitives.go split into bool.go and number.go, interfaces implemented marked, a few .gitignore files updated
* removing old binary names
2016-05-13 19:13:19 -04:00

41 lines
576 B
Go

package types
import (
"github.com/attic-labs/noms/ref"
)
type Bool bool
// Value interface
func (v Bool) Equals(other Value) bool {
return v == other
}
func (v Bool) Less(other Value) bool {
if v2, ok := other.(Bool); ok {
return !bool(v) && bool(v2)
}
return true
}
func (v Bool) Ref() ref.Ref {
return getRef(v)
}
func (v Bool) ChildValues() []Value {
return nil
}
func (v Bool) Chunks() []Ref {
return nil
}
func (v Bool) Type() *Type {
return BoolType
}
// ValueWriter - primitive interface
func (v Bool) ToPrimitive() interface{} {
return bool(v)
}