class Sam::Args

Overview

This class presents container for the task arguments. It can handle named arguments and raw array of arguments. Now it supports only String, Int32 and Float64 as value types. To get access to named argument you can use #[](name : String) and #[]?(name : String) methods. For raw attributes there are #[](index : Int32) and #[]?(index : Int32) as well.

Defined in:

sam/args.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(args : Array(String)) #

[View source]
def self.new(_named_args : AllowedHash, _arr = [] of AllowedTypes) #

[View source]
def self.new #

[View source]

Instance Method Detail

def [](index : Int32) #

[View source]
def [](name : String | Symbol) #

[View source]
def []?(index : Int32) : AllowedTypes | Nil #

[View source]
def []?(name : String | Symbol) : AllowedTypes | Nil #

[View source]
def named : Hash(String, Float64 | Int32 | String) #

[View source]
def raw : Array(Float64 | Int32 | String) #

[View source]
def size #

[View source]