Skip to content
Crystal
Chunk
Initializing search
GitHub
Home
Specification
Guides
Tutorials
API
Compiler
Crystal
GitHub
Home
Specification
Specification
About this guide
Comments
Documenting code
Literals
Literals
Nil
Bool
Integers
Floats
Char
String
Symbol
Array
Hash
Range
Regex
Tuple
NamedTuple
Proc
Command
Assignment
Local variables
Control expressions
Control expressions
Truthy and falsey values
if
if
As a suffix
As an expression
Ternary if
if var
if var.is_a?(...)
if var.responds_to?(...)
if var.nil?
if !
unless
case
while
while
break
next
until
&&
||
Requiring files
Types and methods
Types and methods
Everything is an object
The Program
Classes and methods
Classes and methods
new, initialize and allocate
Methods and instance variables
Type inference
Union types
Overloading
Default parameter values and named arguments
Splats and tuples
Type restrictions
Return types
Method arguments
Operators
Visibility
Inheritance
Inheritance
Virtual and abstract types
Class methods
Class variables
finalize
Modules
Generics
Structs
Constants
Enums
Blocks and Procs
Blocks and Procs
Capturing blocks
Proc literal
Block forwarding
Closures
alias
Exception handling
Type grammar
Type reflection
Type reflection
is_a?
nil?
responds_to?
as
as?
typeof
Macros
Macros
Macro methods
Hooks
Fresh variables
Annotations
Annotations
Built-in annotations
Low-level primitives
Low-level primitives
pointerof
sizeof
instance_sizeof
offsetof
Uninitialized variable declaration
Compile-time flags
Compile-time flags
Cross-compilation
C bindings
C bindings
lib
fun
fun
out
to_unsafe
struct
union
enum
Variables
Constants
type
alias
Callbacks
Unsafe code
Guides
Tutorials
Tutorials
Basics
Basics
Hello World
Variables
Math
Strings
Control Flow
Methods
API
API
ArgumentError
Array
Atomic
Atomic
Flag
Base64
Base64
Error
Benchmark
Benchmark
BM
BM
Job
Tms
IPS
IPS
Entry
Job
BigDecimal
BigFloat
BigInt
BigRational
BitArray
Bool
Box
Bytes
Channel
Channel
ClosedError
Char
Char
Reader
Class
Colorize
Colorize
Color
Color256
ColorANSI
ColorRGB
Object
ObjectExtensions
Comparable
Complex
Compress
Compress
Deflate
Deflate
Error
Reader
Strategy
Writer
Gzip
Gzip
Error
Header
Reader
Writer
Zip
Zip
CompressionMethod
Error
File
File
Entry
FileInfo
Reader
Reader
Entry
Writer
Writer
Entry
Zlib
Zlib
Error
Reader
Writer
Crypto
Crypto
Bcrypt
Bcrypt
Error
Password
Blowfish
Subtle
Crystal
Crystal
MacroInterpreter
MacroInterpreter
MacroVarKey
ReplaceBlockVarsTransformer
Macros
Macros
And
Annotation
Arg
ArrayLiteral
Assign
ASTNode
BinaryOp
Block
BoolLiteral
Call
Case
Cast
CharLiteral
ClassDef
ClassVar
Def
Expressions
Generic
Global
HashLiteral
If
ImplicitObj
InstanceSizeOf
InstanceVar
IsA
Macro
MacroId
MetaVar
MultiAssign
NamedArgument
NamedTupleLiteral
NilableCast
NilLiteral
Nop
Not
NumberLiteral
OffsetOf
Or
Out
Path
PointerOf
ProcLiteral
ProcNotation
ProcPointer
RangeLiteral
ReadInstanceVar
RegexLiteral
Require
RespondsTo
SizeOf
Splat
StringInterpolation
StringLiteral
SymbolLiteral
TupleLiteral
TypeDeclaration
TypeNode
UnaryExpression
UninitializedVar
Union
Var
VisibilityModifier
When
While
Program
Program
CompiledMacroRun
MacroRunResult
RequireWithTimestamp
CSV
CSV
Builder
Builder
Quoting
Row
Error
Lexer
MalformedCSVError
Parser
Row
Token
Token
Kind
Deprecated
Deque
Digest
Digest
Adler32
ClassMethods
CRC32
FinalizedError
MD5
SHA1
SHA256
SHA512
Dir
DivisionByZeroError
ECR
Enum
Enum
ValueConverter
Enumerable
Enumerable
Chunk
Chunk
Alone
Drop
EmptyError
ENV
Errno
Exception
Experimental
Fiber
File
File
AccessDeniedError
AlreadyExistsError
BadPatternError
Error
Flags
Info
NotFoundError
Permissions
Type
FileUtils
Flags
Float
Float
Primitive
Float32
Float64
GC
GC
ProfStats
Stats
Hash
Hash
Entry
HTML
HTTP
HTTP
Client
Client
BodyType
Response
TLSContext
CompressHandler
Cookie
Cookie
SameSite
Cookies
ErrorHandler
FormData
FormData
Builder
Error
FileMetadata
Parser
Part
Handler
Handler
HandlerProc
Headers
LogHandler
Params
Request
Server
Server
ClientError
Context
RequestProcessor
Response
StaticFileHandler
StaticFileHandler
DirectoryListing
Status
WebSocket
WebSocket
CloseCode
WebSocketHandler
Indexable
IndexError
INI
INI
ParseException
Int
Int
BinaryPrefixFormat
Primitive
Signed
Unsigned
Int128
Int16
Int32
Int64
Int8
Intrinsics
InvalidBigDecimalException
InvalidByteSequenceError
IO
IO
Buffered
ByteFormat
ByteFormat
BigEndian
LittleEndian
NetworkEndian
SystemEndian
Delimited
Digest
Digest
DigestMode
EncodingOptions
EOFError
Error
Evented
FileDescriptor
Hexdump
Memory
MultiWriter
Seek
Sized
Stapled
TimeoutError
IPSocket
Iterable
Iterator
Iterator
IteratorWrapper
Stop
JSON
JSON
Any
Any
Type
ArrayConverter
Builder
Builder
ArrayState
DocumentEndState
DocumentStartState
ObjectState
StartState
State
Error
Field
HashValueConverter
Lexer
ParseException
Parser
PullParser
PullParser
Kind
Serializable
Serializable
Options
Strict
Unmapped
SerializableError
Token
Token
Kind
KeyError
Levenshtein
Levenshtein
Finder
Link
LLVM
LLVM
ABI
ABI
AArch64
ArgKind
ArgType
ARM
FunctionType
X86
X86_64
X86_64
RegClass
X86_Win64
AtomicOrdering
AtomicRMWBinOp
Attribute
AttributeIndex
BasicBlock
BasicBlockCollection
Builder
CallConvention
CodeGenFileType
CodeGenOptLevel
CodeModel
Context
DIBuilder
DIFlags
DwarfTag
DwarfTypeEncoding
Function
FunctionCollection
FunctionPassManager
FunctionPassManager
Runner
GenericValue
GlobalCollection
InstructionCollection
IntPredicate
JITCompiler
Linkage
MemoryBuffer
Metadata
Metadata
Type
Module
ModuleFlag
ModulePassManager
OperandBundleDef
ParameterCollection
PassManagerBuilder
PassRegistry
PhiTable
RealPredicate
RelocMode
Target
TargetData
TargetMachine
Type
Type
Kind
Value
Value
Kind
ValueMethods
VerifierFailureAction
Log
Log
AsyncDispatcher
Backend
BroadcastBackend
Builder
Configuration
Context
DirectDispatcher
Dispatcher
Dispatcher
Spec
DispatchMode
Emitter
EntriesChecker
Entry
Formatter
IOBackend
MemoryBackend
Metadata
Metadata
Entry
Value
Value
Type
Severity
ShortFormat
StaticFormatter
SyncDispatcher
Math
MIME
MIME
Error
MediaType
Multipart
Multipart
Builder
Error
Parser
Mutex
Mutex
Protection
NamedTuple
Nil
NilAssertionError
NotImplementedError
Number
Number
Primitive
RoundingMode
OAuth
OAuth
AccessToken
Consumer
Error
RequestToken
OAuth2
OAuth2
AccessToken
AccessToken
Bearer
Mac
AuthScheme
Client
Error
Session
Object
OpenSSL
OpenSSL
Algorithm
Cipher
Cipher
Error
Digest
Digest
Error
UnsupportedError
Error
HMAC
MD5
PKCS5
SHA1
SSL
SSL
Context
Context
Client
Server
Error
ErrorType
Modes
Options
Server
Socket
Socket
Client
Server
VerifyMode
X509VerifyFlags
OptionParser
OptionParser
Exception
InvalidOption
MissingOption
OverflowError
Path
Path
Error
Kind
Pointer
Pointer
Appender
PrettyPrint
Proc
Process
Process
Env
ExecStdio
Redirect
Status
Stdio
Tms
Random
Random
ISAAC
PCG32
Secure
Range
Reference
Regex
Regex
MatchData
Options
RuntimeError
SemanticVersion
SemanticVersion
Prerelease
Set
Signal
Slice
Socket
Socket
Address
Addrinfo
Addrinfo
Error
BindError
ConnectError
Error
Family
FamilyT
IPAddress
Protocol
Server
Type
UNIXAddress
Spec
Spec
Context
Example
Example
Procsy
ExampleGroup
ExampleGroup
Procsy
Expectations
Item
Methods
ObjectExtensions
SplitFilter
StaticArray
Steppable
Steppable
StepIterator
String
String
Builder
RawConverter
StringPool
StringScanner
Struct
Symbol
System
System
Group
Group
NotFoundError
User
User
NotFoundError
SystemError
SystemError
ClassMethods
TCPServer
TCPSocket
Termios
Termios
AttributeSelection
BaudRate
ControlMode
InputMode
LineControl
LocalMode
OutputMode
Time
Time
DayOfWeek
EpochConverter
EpochMillisConverter
FloatingTimeConversionError
Format
Format
Error
HTTP_DATE
ISO_8601_DATE
ISO_8601_DATE_TIME
ISO_8601_TIME
RFC_2822
RFC_3339
YAML_DATE
Location
Location
InvalidLocationNameError
InvalidTimezoneOffsetError
InvalidTZDataError
Zone
MonthSpan
Span
Tuple
TypeCastError
UDPSocket
UInt128
UInt16
UInt32
UInt64
UInt8
Unicode
Unicode
CaseOptions
Union
UNIXServer
UNIXSocket
URI
URI
Error
Params
Params
Builder
Punycode
UUID
UUID
Error
Variant
Version
VaList
Value
WeakRef
WinError
XML
XML
Attributes
AttributeType
Builder
Error
HTMLParserOptions
Namespace
Node
Node
Type
NodeSet
ParserOptions
Reader
Reader
Type
SaveOptions
XPathContext
YAML
YAML
Any
Any
Type
ArrayConverter
Builder
Error
EventKind
Field
MappingStyle
Nodes
Nodes
Alias
Builder
Document
Mapping
Node
Scalar
Sequence
ParseContext
ParseException
PullParser
ScalarStyle
Schema
Schema
Core
FailSafe
SequenceStyle
Serializable
Serializable
Options
Strict
Unmapped
Compiler
module
Enumerable::Chunk
¶