class Term::Prompt::Choices

Overview

A class responsible for storing a collection of choices

@api private

Included Modules

Defined in:

prompt/choices.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(choices = [] of String) #

Create Choices collection


[View source]

Class Method Detail

def self.[](*choices) #

Convenience for creating choices


[View source]

Instance Method Detail

def <<(choice) #

Add choice to collection


[View source]
def [](index) #

Access choice by index


[View source]
def []?(index) #

[View source]
def choices : Array(Choice) #

The actual collection choices


[View source]
def each(*args, **options) #

[View source]
def each(*args, **options, &) #

[View source]
def empty?(*args, **options) #

[View source]
def empty?(*args, **options, &) #

[View source]
def index(*args, **options) #

[View source]
def index(*args, **options, &) #

[View source]
def pluck(name) #

Pluck a choice by its name from collection


[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def to_a(*args, **options) #

[View source]
def to_a(*args, **options, &) #

[View source]
def values_at(*args, **options) #

[View source]
def values_at(*args, **options, &) #

[View source]