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.
-
#href ⇒ Object
Returns the value of attribute href.
-
#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 15 |
# File 'lib/restpack_core_client/models/application.rb', line 5 def initialize(data, channel) @domains = [] @configurations = [] @id = data[:id].to_i @name = data[:name] @href = data[:href] @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 |
#href ⇒ Object
Returns the value of attribute href.
3 4 5 |
# File 'lib/restpack_core_client/models/application.rb', line 3 def href @href 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
30 31 32 |
# File 'lib/restpack_core_client/models/application.rb', line 30 def auth_domain known_domain_names[:auth] end |
#get_configuration_by_key(key) ⇒ Object
17 18 19 |
# File 'lib/restpack_core_client/models/application.rb', line 17 def get_configuration_by_key(key) @configurations.find { |c| c.key == key.to_s } end |
#home_domain ⇒ Object
TODO: GJ: dynamic
26 27 28 |
# File 'lib/restpack_core_client/models/application.rb', line 26 def home_domain #TODO: GJ: dynamic known_domain_names[:home] end |
#known_domain_names ⇒ Object
21 22 23 24 |
# File 'lib/restpack_core_client/models/application.rb', line 21 def known_domain_names configuration = get_configuration_by_key(:domains) configuration.nil? ? {} : configuration.value end |