Class: TestKitchen::Platform::Version

Inherits:
Object
  • Object
show all
Includes:
Chef::Mixin::ParamsValidate
Defined in:
lib/test-kitchen/platform.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Version

Returns a new instance of Version.

Raises:

  • (ArgumentError)


46
47
48
49
50
# File 'lib/test-kitchen/platform.rb', line 46

def initialize(name, &block)
  raise ArgumentError, "Version name must be specified" if name.nil? || name.empty?
  @name = name
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#box(arg = nil) ⇒ Object



52
53
54
# File 'lib/test-kitchen/platform.rb', line 52

def box(arg=nil)
  set_or_return(:box, arg, {})
end

#box_url(arg = nil) ⇒ Object



56
57
58
# File 'lib/test-kitchen/platform.rb', line 56

def box_url(arg=nil)
  set_or_return(:box_url, arg, {})
end

#nameObject (readonly)

Returns the value of attribute name.



43
44
45
# File 'lib/test-kitchen/platform.rb', line 43

def name
  @name
end