struct
Agate::Signature
- Agate::Signature
- Struct
- Value
- Object
Overview
An immutable git signature (author or committer).
This is a pure Crystal value type -- no C pointers, no finalization. Data is extracted eagerly from the C struct at the boundary.
Defined in:
agate/signature.crConstructors
-
.create(name : String, email : String, time : Time, offset : Int32 | Nil = nil) : Signature
Creates a signature via libgit2 with the given name, email, time, and timezone offset (in minutes).
-
.default(repo) : Signature
Creates a signature from the repository's default config (user.name and user.email).
-
.from_buffer(buf : String) : Signature
Parses a signature from a buffer in the format "Name
timestamp offset". - .new(name : String, email : String, time : Time, offset : Int32)
-
.now(name : String, email : String) : Signature
Creates a signature with the given name, email, and the current time.
Class Method Summary
-
.default?(repo) : Signature | Nil
Creates a signature from the repository's default config, or nil if user.name/email aren't configured.
-
.from_buffer?(buf : String) : Signature | Nil
Parses a signature from a buffer, returning nil on failure.
Instance Method Summary
- #clone
- #copy_with(name _name = @name, email _email = @email, time _time = @time, offset _offset = @offset)
- #email : String
- #name : String
- #offset : Int32
- #time : Time
Constructor Detail
Creates a signature via libgit2 with the given name, email, time, and timezone offset (in minutes).
Creates a signature from the repository's default config (user.name and user.email).
Parses a signature from a buffer in the format
"Name
Creates a signature with the given name, email, and the current time.
Class Method Detail
Creates a signature from the repository's default config, or nil if user.name/email aren't configured.
Parses a signature from a buffer, returning nil on failure.