Class: Goru::Bridge

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

Overview

public

Constant Summary collapse

STATUS_READY =
public
:ready
STATUS_FINISHED =
public
:finished
STATUS_IDLE =
public
:idle

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(routine:, channel:) ⇒ Bridge

Returns a new instance of Bridge.



7
8
9
10
11
12
# File 'lib/goru/bridge.rb', line 7

def initialize(routine:, channel:)
  @routine = routine
  @channel = channel
  @channel.add_observer(self)
  update_status
end

Instance Attribute Details

#statusObject (readonly)

public


28
29
30
# File 'lib/goru/bridge.rb', line 28

def status
  @status
end

Instance Method Details

#channel_closedObject



61
62
63
# File 'lib/goru/bridge.rb', line 61

def channel_closed
  update_status
end

#channel_readObject



57
58
59
# File 'lib/goru/bridge.rb', line 57

def channel_read
  update_status
end

#channel_receivedObject



53
54
55
# File 'lib/goru/bridge.rb', line 53

def channel_received
  update_status
end

#update_statusObject

public


39
40
41
# File 'lib/goru/bridge.rb', line 39

def update_status
  # noop
end