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
13
# File 'lib/restpack_core_client/models/channel.rb', line 5

def initialize(data)
  @applications   = []
  @domains        = []
  @configurations = []

  @id = data[:id].to_i
  @name = data[:name]
  @href = data[:href]
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

#hrefObject

Returns the value of attribute href.



3
4
5
# File 'lib/restpack_core_client/models/channel.rb', line 3

def href
  @href
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



15
16
17
# File 'lib/restpack_core_client/models/channel.rb', line 15

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

#get_configuration(id) ⇒ Object



27
28
29
# File 'lib/restpack_core_client/models/channel.rb', line 27

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

#get_domain(id) ⇒ Object



19
20
21
# File 'lib/restpack_core_client/models/channel.rb', line 19

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

#get_domain_by_host(host) ⇒ Object



23
24
25
# File 'lib/restpack_core_client/models/channel.rb', line 23

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