Sha256: 400d27df6ad236c334e74d9ed6268dfb6b7ae0c1725fa420a902b5d28852ca01

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

require 'fog/vcloud_director/models/compute/vm_customization'

module Fog
  module VcloudDirector
    class Compute
      class VmCustomizations < Collection
        model Fog::VcloudDirector::Compute::VmCustomization

        attribute :vm

        private

        def get_by_id(item_id)
          item = service.get_vm_customization(item_id).body
          add_id_from_href!(item)
          item
        end

        # The HREF returned for a VM customization object is actually the VM
        # HREF suffixed with '/guestCustomizationSection/' so we cannot use
        # service.add_id_from_href! like all other collections.
        def add_id_from_href!(item={})
          item[:id] = item[:href].gsub('/guestCustomizationSection/', '').split('/').last
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-vcloud-director-0.3.1 lib/fog/vcloud_director/models/compute/vm_customizations.rb
fog-vcloud-director-0.3.0 lib/fog/vcloud_director/models/compute/vm_customizations.rb