Class: Channel::ReceiveOnly

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

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ ReceiveOnly



111
112
113
# File 'lib/channel.rb', line 111

def initialize(channel)
  @channel = channel
end

Instance Method Details

#closeObject



126
127
128
# File 'lib/channel.rb', line 126

def close
  @channel.close
end

#closed?Boolean



130
131
132
# File 'lib/channel.rb', line 130

def closed?
  @channel.closed?
end

#hashObject



144
145
146
# File 'lib/channel.rb', line 144

def hash
  @channel.hash
end

#receive_only!Object Also known as: r!



134
135
136
# File 'lib/channel.rb', line 134

def receive_only!
  self
end

#recvObject Also known as: pop



115
116
117
# File 'lib/channel.rb', line 115

def recv
  @channel.recv
end

#send(_) ⇒ Object Also known as: push



120
121
122
# File 'lib/channel.rb', line 120

def send(_)
  fail Direction, 'receive only'
end

#send_only!Object Also known as: s!



139
140
141
# File 'lib/channel.rb', line 139

def send_only!
  fail Conversion, 'receive only'
end