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 collapse

@@io =

Default value for display output.

STDOUT
@@hook =

Hooks.

{}

Class Method Summary collapse

Class Method Details

.getIoObject

Get @@io.



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

def ComoCommon.getIo
    @@io
end

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

Run hook.

Parameters:

  • name (String)

    Hook name.

Yields:

  • code Hook arguments.



555
556
557
# File 'lib/como.rb', line 555

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

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

Set hook content.

Parameters:

  • name (String)

    Hook name.

Yields:

  • code Hook code.



547
548
549
# File 'lib/como.rb', line 547

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

.setIo(io) ⇒ Object

Set @@io.



534
535
536
# File 'lib/como.rb', line 534

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