Class: Awsome::Elb::LoadBalancer

Inherits:
Object
  • Object
show all
Defined in:
lib/awsome/elb/load_balancer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property_hash) ⇒ LoadBalancer

Returns a new instance of LoadBalancer.



6
7
8
# File 'lib/awsome/elb/load_balancer.rb', line 6

def initialize(property_hash)
  @properties = property_hash.clone
end

Instance Attribute Details

#propertiesObject (readonly)

Returns the value of attribute properties.



4
5
6
# File 'lib/awsome/elb/load_balancer.rb', line 4

def properties
  @properties
end

Instance Method Details

#deregister(instance_id) ⇒ Object



14
15
16
# File 'lib/awsome/elb/load_balancer.rb', line 14

def deregister(instance_id)
  Awsome::Elb.deregister_instance_from_lb(@properties['name'], instance_id)
end

#instancesObject



10
11
12
# File 'lib/awsome/elb/load_balancer.rb', line 10

def instances
  @properties['instance_ids'].gsub('"', '').split(',').collect(&:strip).to_set
end

#nameObject



22
23
24
# File 'lib/awsome/elb/load_balancer.rb', line 22

def name
  @properties['name']
end

#register(instance_id) ⇒ Object



18
19
20
# File 'lib/awsome/elb/load_balancer.rb', line 18

def register(instance_id)
  Awsome::Elb.register_instance_with_lb(@properties['name'], instance_id)
end