Class: Endpoint

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Endpoint

Returns a new instance of Endpoint.



2
3
4
# File 'lib/endpoint.rb', line 2

def initialize(config)
  @config = config
end

Instance Method Details

#addressObject



6
7
8
# File 'lib/endpoint.rb', line 6

def address
  @config.keys.first
end

#channel_idsObject



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/endpoint.rb', line 10

def channel_ids
  channel_ids = []

  @config.values.each do |settings|
    settings.each do |setting|
      setting['channel_ids'].each do |channel_id|
        channel_ids << channel_id
      end
    end
  end

  channel_ids
end