Class: RestPack::Core::Client::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/restpack-core-client/models/channel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Channel

Returns a new instance of Channel.



5
6
7
8
9
10
11
12
# File 'lib/restpack-core-client/models/channel.rb', line 5

def initialize(data)
  @applications   = []
  @domains        = []
  @configurations = []
  
  @id = data[:channel][:id]
  @name = data[:channel][:name]
end

Instance Attribute Details

#applicationsObject

Returns the value of attribute applications.



3
4
5
# File 'lib/restpack-core-client/models/channel.rb', line 3

def applications
  @applications
end

#configurationsObject

Returns the value of attribute configurations.



3
4
5
# File 'lib/restpack-core-client/models/channel.rb', line 3

def configurations
  @configurations
end

#domainsObject

Returns the value of attribute domains.



3
4
5
# File 'lib/restpack-core-client/models/channel.rb', line 3

def domains
  @domains
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/restpack-core-client/models/channel.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/restpack-core-client/models/channel.rb', line 3

def name
  @name
end

Instance Method Details

#get_application(id) ⇒ Object



14
15
16
# File 'lib/restpack-core-client/models/channel.rb', line 14

def get_application(id)
  @applications.find { |a| a.id == id }
end

#get_configuration(id) ⇒ Object



26
27
28
# File 'lib/restpack-core-client/models/channel.rb', line 26

def get_configuration(id)
  @configurations.find { |a| a.id == id }
end

#get_domain(id) ⇒ Object



18
19
20
# File 'lib/restpack-core-client/models/channel.rb', line 18

def get_domain(id)
  @domains.find { |a| a.id == id }
end

#get_domain_by_host(host) ⇒ Object



22
23
24
# File 'lib/restpack-core-client/models/channel.rb', line 22

def get_domain_by_host(host)
  @domains.find { |a| a.host == host }
end