Class: Boxcutter::LoadBalancer::Application
- Inherits:
-
Object
- Object
- Boxcutter::LoadBalancer::Application
- Defined in:
- lib/boxcutter/load_balancer/application.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(api, attrs) ⇒ Application
constructor
A new instance of Application.
- #ip_v4 ⇒ Object
- #ip_v6 ⇒ Object
- #name ⇒ Object
- #services ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(api, attrs) ⇒ Application
Returns a new instance of Application.
15 16 17 18 |
# File 'lib/boxcutter/load_balancer/application.rb', line 15 def initialize(api, attrs) @api = api @attrs = attrs end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
13 14 15 |
# File 'lib/boxcutter/load_balancer/application.rb', line 13 def api @api end |
Class Method Details
Instance Method Details
#id ⇒ Object
24 25 26 |
# File 'lib/boxcutter/load_balancer/application.rb', line 24 def id @attrs["id"] end |
#ip_v4 ⇒ Object
28 29 30 |
# File 'lib/boxcutter/load_balancer/application.rb', line 28 def ip_v4 @attrs["ip_v4"] end |
#ip_v6 ⇒ Object
32 33 34 |
# File 'lib/boxcutter/load_balancer/application.rb', line 32 def ip_v6 @attrs["ip_v6"] end |
#name ⇒ Object
36 37 38 |
# File 'lib/boxcutter/load_balancer/application.rb', line 36 def name @attrs["name"] end |
#services ⇒ Object
40 41 42 |
# File 'lib/boxcutter/load_balancer/application.rb', line 40 def services api.services(id).map {|attrs| Service.new(api, attrs)} end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/boxcutter/load_balancer/application.rb', line 20 def to_s "#<Application id:'#{id}' name:'#{name}' ip_v4:'#{ip_v4}' ip_v6:'#{ip_v6}'>" end |