struct
Agate::OID
- Agate::OID
- Struct
- Value
- Object
Overview
Represents a git object ID (SHA1 hash).
Included Modules
- Comparable(Agate::OID)
Defined in:
agate/oid.crConstant Summary
-
HEXSIZE =
C::SHA1_HEXSIZE -
The size in hex characters of a formatted SHA1 OID.
-
SIZE =
C::SHA1_SIZE -
The size in bytes of a raw SHA1 OID.
-
ZERO =
new(C::OID.new) -
An all-zero OID.
Constructors
-
.parse(hex : String) : OID
Parses a hex string into an OID.
Class Method Summary
-
.parse?(hex : String) : OID | Nil
Parses a (possibly abbreviated) hex string into an OID.
-
.valid?(hex : String) : Bool
Returns true if the given string is a valid full 40-character hex OID.
Instance Method Summary
-
#<=>(other : OID) : Int32
Three-way comparison.
-
#==(other : OID) : Bool
Equality comparison.
-
#==(hex : String) : Bool
Equality comparison with a hex string.
-
#hex : String
Returns the hex string representation of this OID.
-
#to_s(io : IO) : Nil
Returns the hex string representation of this OID.
-
#zero? : Bool
Returns true if this OID is all zeros.
Constructor Detail
Class Method Detail
Parses a (possibly abbreviated) hex string into an OID.
def self.valid?(hex : String) : Bool
#
Returns true if the given string is a valid full 40-character hex OID.