Class: Legion::Gaia::ChannelAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/gaia/channel_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel_id:, capabilities: []) ⇒ ChannelAdapter

Returns a new instance of ChannelAdapter.



8
9
10
11
12
# File 'lib/legion/gaia/channel_adapter.rb', line 8

def initialize(channel_id:, capabilities: [])
  @channel_id = channel_id
  @capabilities = capabilities
  @started = false
end

Instance Attribute Details

#capabilitiesObject (readonly)

Returns the value of attribute capabilities.



6
7
8
# File 'lib/legion/gaia/channel_adapter.rb', line 6

def capabilities
  @capabilities
end

#channel_idObject (readonly)

Returns the value of attribute channel_id.



6
7
8
# File 'lib/legion/gaia/channel_adapter.rb', line 6

def channel_id
  @channel_id
end

Instance Method Details

#deliver(output_frame) ⇒ Object

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/legion/gaia/channel_adapter.rb', line 34

def deliver(output_frame)
  raise NotImplementedError, "#{self.class}#deliver must be implemented"
end

#startObject



14
15
16
# File 'lib/legion/gaia/channel_adapter.rb', line 14

def start
  @started = true
end

#started?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/legion/gaia/channel_adapter.rb', line 22

def started?
  @started
end

#stopObject



18
19
20
# File 'lib/legion/gaia/channel_adapter.rb', line 18

def stop
  @started = false
end

#supports?(capability) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/legion/gaia/channel_adapter.rb', line 38

def supports?(capability)
  capabilities.include?(capability)
end

#translate_inbound(raw_input) ⇒ Object

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/legion/gaia/channel_adapter.rb', line 26

def translate_inbound(raw_input)
  raise NotImplementedError, "#{self.class}#translate_inbound must be implemented"
end

#translate_outbound(output_frame) ⇒ Object

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/legion/gaia/channel_adapter.rb', line 30

def translate_outbound(output_frame)
  raise NotImplementedError, "#{self.class}#translate_outbound must be implemented"
end