Class: SubSpawn::IoHolder

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

Defined Under Namespace

Classes: Composite, PTY, Pipe

Instance Method Summary collapse

Constructor Details

#initialize(map) ⇒ IoHolder

Returns a new instance of IoHolder.



3
4
5
# File 'lib/subspawn/pipes.rb', line 3

def initialize(map)
	@map = map
end

Instance Method Details

#[](key) ⇒ Object



7
8
9
10
11
# File 'lib/subspawn/pipes.rb', line 7

def [](key)
	tmp = get(key)
	tmp = tmp.to_io if tmp.respond_to? :to_io
	tmp
end

#composite?(key) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/subspawn/pipes.rb', line 15

def composite? key
	self.get(key).is_a? Composite
end

#empty?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/subspawn/pipes.rb', line 18

def empty?
	@map.values.reject(&:nil?).empty?
end

#get(key) ⇒ Object



12
13
14
# File 'lib/subspawn/pipes.rb', line 12

def get(key)
	@map[SubSpawn::Internal.parse_fd(key, true)]
end