Class: AwsClient::Elb

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_data) ⇒ Elb

Returns a new instance of Elb.



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

def initialize(raw_data)
  @raw_data = raw_data
end

Instance Attribute Details

#raw_dataObject (readonly)

Returns the value of attribute raw_data.



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

def raw_data
  @raw_data
end

#raw_tagsObject (readonly)

Returns the value of attribute raw_tags.



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

def raw_tags
  @raw_tags
end

Instance Method Details

#add_tags!(tag_data) ⇒ Object



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

def add_tags!(tag_data)
  @raw_tags = tag_data.tags
end

#dns_nameObject



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

def dns_name
  @raw_data.dns_name
end

#is_for_tag?(tag_key, tag_value) ⇒ Boolean

Returns:

  • (Boolean)


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

def is_for_tag?(tag_key, tag_value)
  tags.include?({ tag_key => tag_value})
end

#nameObject



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

def name
  @raw_data.load_balancer_name
end

#tagsObject



26
27
28
# File 'lib/elb.rb', line 26

def tags
  @tags ||= @raw_tags.collect{|raw_tag| {raw_tag.key => raw_tag.value } }
end