Class: Aeolus::Image::Warehouse::Icicle
Instance Attribute Summary
#body
Instance Method Summary
collapse
#==, all, #bucket_object, bucket_objects, config, config=, create!, delete, find, first, #id, #initialize, iwhd_url, last, oauth_consumer_key, oauth_consumer_secret, #set_attr, set_warehouse_and_bucket, use_oauth?, where
Instance Method Details
#description ⇒ Object
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/aeolus_image/model/warehouse/icicle.rb', line 33
def description
unless @description
begin
@description = get_icicle.xpath('icicle/description').text
rescue
@description = []
end
end
@description
end
|
#get_icicle ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/aeolus_image/model/warehouse/icicle.rb', line 44
def get_icicle
unless @icicle_xml
icicle = Icicle.bucket.objects.find(@uuid) if @uuid
begin
@icicle_xml = Nokogiri::XML icicle.first.body
rescue
@icicle_xml = Nokogiri::XML '<icicle></icicle>'
end
end
@icicle_xml
end
|
#packages ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/aeolus_image/model/warehouse/icicle.rb', line 21
def packages
unless @packages
begin
package_elems = get_icicle.xpath('icicle/packages/package')
@packages = package_elems.map { |node| node.attributes['name'].text }
rescue
@packages = []
end
end
@packages
end
|