Class: Fog::Compute::Linode::Kernels
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::Linode::Kernels
- Defined in:
- lib/fog/linode/models/compute/kernels.rb
Instance Method Summary collapse
-
#all(options = {}) ⇒ Object
Returns an Array of the available kernels.
- #get(id) ⇒ Object
Instance Method Details
#all(options = {}) ⇒ Object
Returns an Array of the available kernels.
The list of kernels can be filtered by support for KVM or Xen by specifying kvm: true or xen: true respectively as options.
14 15 16 17 18 19 |
# File 'lib/fog/linode/models/compute/kernels.rb', line 14 def all(={}) [[:kvm, :isKVM], [:xen, :isXen]].each do |type, param| [param] = [type] ? 1 : 0 if .has_key?(type) end load kernels() end |
#get(id) ⇒ Object
21 22 23 |
# File 'lib/fog/linode/models/compute/kernels.rb', line 21 def get(id) new kernels.select {|kernel| kernel[:id] == id }.first end |