Class: RestPack::Core::Client::Application
- Inherits:
-
Object
- Object
- RestPack::Core::Client::Application
- Defined in:
- lib/restpack-core-client/models/application.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#configurations ⇒ Object
Returns the value of attribute configurations.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #auth_domain ⇒ Object
- #get_configuration_by_key(key) ⇒ Object
-
#home_domain ⇒ Object
TODO: GJ: dynamic.
-
#initialize(data, channel) ⇒ Application
constructor
A new instance of Application.
- #known_domain_names ⇒ Object
Constructor Details
#initialize(data, channel) ⇒ Application
Returns a new instance of Application.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/restpack-core-client/models/application.rb', line 5 def initialize(data, channel) @domains = [] @configurations = [] @id = data[:id] @name = data[:name] @channel = channel @channel.applications << self end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
3 4 5 |
# File 'lib/restpack-core-client/models/application.rb', line 3 def channel @channel end |
#configurations ⇒ Object
Returns the value of attribute configurations.
3 4 5 |
# File 'lib/restpack-core-client/models/application.rb', line 3 def configurations @configurations end |
#domains ⇒ Object
Returns the value of attribute domains.
3 4 5 |
# File 'lib/restpack-core-client/models/application.rb', line 3 def domains @domains end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/restpack-core-client/models/application.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/restpack-core-client/models/application.rb', line 3 def name @name end |
Instance Method Details
#auth_domain ⇒ Object
29 30 31 |
# File 'lib/restpack-core-client/models/application.rb', line 29 def auth_domain known_domain_names[:auth] end |
#get_configuration_by_key(key) ⇒ Object
16 17 18 |
# File 'lib/restpack-core-client/models/application.rb', line 16 def get_configuration_by_key(key) @configurations.find { |c| c.key == key.to_s } end |
#home_domain ⇒ Object
TODO: GJ: dynamic
25 26 27 |
# File 'lib/restpack-core-client/models/application.rb', line 25 def home_domain #TODO: GJ: dynamic known_domain_names[:home] end |
#known_domain_names ⇒ Object
20 21 22 23 |
# File 'lib/restpack-core-client/models/application.rb', line 20 def known_domain_names configuration = get_configuration_by_key(:domains) configuration.nil? ? {} : configuration.value end |