Class: BoxGrinder::LibvirtCapabilities::Plugin

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, domain_rank) ⇒ Plugin



47
48
49
50
51
52
53
54
# File 'lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb', line 47

def initialize(name, domain_rank)
  @name = name
  @domain_map = domain_rank.enum_for(:each_with_index).inject({}) do |accum, (domain, rank)|
    accum.merge(domain.name => {:domain => domain, :rank => rank})
  end
  @domain_map.freeze
  @domain_rank = domain_rank.freeze
end

Instance Attribute Details

#domain_mapObject

Returns the value of attribute domain_map.



46
47
48
# File 'lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb', line 46

def domain_map
  @domain_map
end

#domain_rankObject

Returns the value of attribute domain_rank.



46
47
48
# File 'lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb', line 46

def domain_rank
  @domain_rank
end

#nameObject

Returns the value of attribute name.



46
47
48
# File 'lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb', line 46

def name
  @name
end

Instance Method Details

#<=>(other) ⇒ Object



56
57
58
# File 'lib/boxgrinder-build/plugins/delivery/libvirt/libvirt-capabilities.rb', line 56

def <=>(other)
 self.name <=> other.name
end