API Docs for:
Show:

Formatter Class

Defined in: ../lib/pat.js:231
Module: pat

Allocates a new formatter with the specified options.

Constructor

Formatter

(
  • [options]
)
Formatter

Defined in ../lib/pat.js:231

Parameters:

  • [options] Object optional

Returns:

Item Index

Methods

Properties

Methods

format

(
  • fstr
  • [data]
)
String static

Defined in ../lib/pat.js:348

Formats the given arguments described by the given formatstring.

Parameters:

  • fstr String

    Format string

  • [data] Any optional multiple

    Data to be formatted

Returns:

String: Formatted data

format

(
  • fstr
  • [data]
)
String

Defined in ../lib/pat.js:423

Formats the given arguments described by the given formatstring.

Parameters:

  • fstr String

    Format string

  • [data] Any optional multiple

    Data to be formatted

Returns:

String: Formatted data

options

(
  • [options]
)
Formatter | Object static chainable

Defined in ../lib/pat.js:324

Sets the Formatter options or returns them if called without an argument.

Parameters:

  • [options] Object optional

    Formatter options:

     {
         path: './',
         flavorId: 'flavorId',
         cultureId: 'cultureId',
         lineSeparator: '\n'
     }
    

Returns:

Formatter | Object:
 Formatter if called as setter, Formatter options if called as getter

options

(
  • [options]
)
Object chainable

Defined in ../lib/pat.js:360

Sets this Formatter's options or returns them if called without an argument.

Parameters:

  • [options] Object optional

    Formatter options:

     {
         path: './',
         flavorId: 'flavorId',
         cultureId: 'cultureId',
         lineSeparator: '\n'
     }
    

Returns:

Object: This Formatter's options if called as a getter, this if called as a setter

reset

() Formatter static chainable

Defined in ../lib/pat.js:250

Resets the Formatter.

Returns:

validateCulture

(
  • culture
)
Formatter static chainable

Defined in ../lib/pat.js:261

Tests if the given argument represents a valid culture object. Throws an error if it is not valid.

Parameters:

  • culture Object

Returns:

Properties

defaultOptions

Object static

Defined in ../lib/pat.js:241

Default options for a new Formatter. Overwrite this property if you intend to allocate several formatters with default options different to those initially specified by this module.