Class: RIO::Ext::Extension

Inherits:
Object show all
Defined in:
lib/rio/ext.rb

Instance Method Summary collapse

Constructor Details

#initialize(etest, mod) ⇒ Extension

Returns a new instance of Extension.



61
62
63
64
65
66
67
# File 'lib/rio/ext.rb', line 61

def initialize(etest,mod)
  @inc = { 
    'cx' => mod+'::Cx',
    'input' => mod+'::Input',
    'output' => mod+'::Output',
  }
end

Instance Method Details

#add(obj, state) ⇒ Object



68
69
70
71
72
73
# File 'lib/rio/ext.rb', line 68

def add(obj,state)
  case state
    when 'Stream::Input' then obj.extend(@inc['input'])
    when 'Stream::Output' then obj.extend(@inc['output'])
  end
end