Class: Channel::SendOnly

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

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ SendOnly

Returns a new instance of SendOnly.



150
151
152
# File 'lib/channel.rb', line 150

def initialize(channel)
  @channel = channel
end

Instance Method Details

#closeObject



165
166
167
# File 'lib/channel.rb', line 165

def close
  @channel.close
end

#closed?Boolean

Returns:

  • (Boolean)


169
170
171
# File 'lib/channel.rb', line 169

def closed?
  @channel.closed?
end

#hashObject



183
184
185
# File 'lib/channel.rb', line 183

def hash
  @channel.hash
end

#receive_only!Object Also known as: r!



173
174
175
# File 'lib/channel.rb', line 173

def receive_only!
  fail Conversion, 'send only'
end

#recvObject Also known as: pop



154
155
156
# File 'lib/channel.rb', line 154

def recv
  fail Direction, 'send only'
end

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



159
160
161
# File 'lib/channel.rb', line 159

def send(val)
  @channel.send(val)
end

#send_only!Object Also known as: s!



178
179
180
# File 'lib/channel.rb', line 178

def send_only!
  self
end