Class: Como::ComoCommon

Inherits:
Object
  • Object
show all
Defined in:
lib/como.rb

Overview

IO stream options for Como classes.

Direct Known Subclasses

Opt, RuleDisplay, Spec

Constant Summary

@@io =

Default value for display output.

STDOUT
@@hook =

Hooks.

{}

Class Method Summary (collapse)

Class Method Details

+ (Object) getIo

Get @@io.



524
525
526
# File 'lib/como.rb', line 524

def ComoCommon.getIo
    @@io
end

+ (Object) runHook(name, args) { ... }

Run hook.

Parameters:

  • name (String)

    Hook name.

Yields:

  • code Hook arguments.



540
541
542
# File 'lib/como.rb', line 540

def ComoCommon.runHook( name, args )
    @@hook[ name ].yield( args ) if @@hook[ name ]
end

+ (Object) setHook(name) { ... }

Set hook content.

Parameters:

  • name (String)

    Hook name.

Yields:

  • code Hook code.



532
533
534
# File 'lib/como.rb', line 532

def ComoCommon.setHook( name, &code )
    @@hook[ name ] = code
end

+ (Object) setIo(io)

Set @@io.



519
520
521
# File 'lib/como.rb', line 519

def ComoCommon.setIo( io )
    @@io = io
end