Class: Description::ELB

Inherits:
Description show all
Defined in:
lib/maws/description/elb.rb

Instance Attribute Summary

Attributes inherited from Description

#description

Instance Method Summary collapse

Methods inherited from Description

#[], create, #create_instance, #index, #logical_zone, #method_missing, #name_re, #prefix, #profile, #region, #role, #zone

Constructor Details

#initialize(description) ⇒ ELB

Returns a new instance of ELB.



2
3
4
5
# File 'lib/maws/description/elb.rb', line 2

def initialize(description)
  description[:service] ||= :elb
  @description = description
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Description

Instance Method Details

#aws_idObject



20
21
22
# File 'lib/maws/description/elb.rb', line 20

def aws_id
  description[:load_balancer_name]
end

#enabled_zonesObject



28
29
30
# File 'lib/maws/description/elb.rb', line 28

def enabled_zones
  availability_zones.map {|z| z[-1,1]}
end

#nameObject



16
17
18
# File 'lib/maws/description/elb.rb', line 16

def name
  description[:load_balancer_name]
end

#physical_zoneObject



12
13
14
# File 'lib/maws/description/elb.rb', line 12

def physical_zone
  nil
end

#region_zoneObject



7
8
9
10
# File 'lib/maws/description/elb.rb', line 7

def region_zone
  # take from AZs it supports, ELBs always have at least one AZ
  availability_zones.first
end

#statusObject



24
25
26
# File 'lib/maws/description/elb.rb', line 24

def status
  'available' if description[:load_balancer_name]
end