Spec-Zone.ru › Pony

Option

[Source]

Option contains a spec and an effective value for a given option.

class val Option

Constructors

create

[Source]

new val create(
  spec': OptionSpec val,
  value': (Bool val | String val | I64 val | 
    U64 val | F64 val | _StringSeq val))
: Option val^

Parameters

  • spec': OptionSpec val
  • value': (Bool val | String val | I64 val | U64 val | F64 val | _StringSeq val)

Returns

  • Option val^

Public Functions

spec

[Source]

fun box spec()
: OptionSpec val

Returns

  • OptionSpec val

bool

[Source]

Returns the option value as a Bool, defaulting to false.

fun box bool()
: Bool val

Returns

  • Bool val

string

[Source]

Returns the option value as a String, defaulting to empty.

fun box string()
: String val

Returns

  • String val

i64

[Source]

Returns the option value as an I64, defaulting to 0.

fun box i64()
: I64 val

Returns

  • I64 val

u64

[Source]

Returns the option value as an U64, defaulting to 0.

fun box u64()
: U64 val

Returns

  • U64 val

f64

[Source]

Returns the option value as an F64, defaulting to 0.0.

fun box f64()
: F64 val

Returns

  • F64 val

string_seq

[Source]

Returns the option value as a ReadSeq[String], defaulting to empty.

fun box string_seq()
: ReadSeq[String val] val

Returns

  • ReadSeq[String val] val

deb_string

[Source]

fun box deb_string()
: String val

Returns

  • String val

© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/cli-Option

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API