Class: ImageBuilder::Builders::Null
- Defined in:
- lib/image_builder/builders/null.rb
Overview
Generic class doc comment
Constant Summary
Constants included from ImageBuilder
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
-
#ssh_password ⇒ Object
Returns the value of attribute ssh_password.
-
#ssh_private_key_file ⇒ Object
Returns the value of attribute ssh_private_key_file.
-
#ssh_username ⇒ Object
Returns the value of attribute ssh_username.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ Null
constructor
A new instance of Null.
- #packer_hash ⇒ Object
Constructor Details
#initialize ⇒ Null
Returns a new instance of Null.
16 17 18 19 20 21 22 |
# File 'lib/image_builder/builders/null.rb', line 16 def initialize @type = 'null' @host = '127.0.0.1' @port = 22 @ssh_username = Etc.getlogin @ssh_private_key_file = ::File.join(::Dir.home, '.ssh', 'id_rsa') end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
8 9 10 |
# File 'lib/image_builder/builders/null.rb', line 8 def host @host end |
#port ⇒ Object
Returns the value of attribute port.
12 13 14 |
# File 'lib/image_builder/builders/null.rb', line 12 def port @port end |
#ssh_password ⇒ Object
Returns the value of attribute ssh_password.
9 10 11 |
# File 'lib/image_builder/builders/null.rb', line 9 def ssh_password @ssh_password end |
#ssh_private_key_file ⇒ Object
Returns the value of attribute ssh_private_key_file.
11 12 13 |
# File 'lib/image_builder/builders/null.rb', line 11 def ssh_private_key_file @ssh_private_key_file end |
#ssh_username ⇒ Object
Returns the value of attribute ssh_username.
10 11 12 |
# File 'lib/image_builder/builders/null.rb', line 10 def ssh_username @ssh_username end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/image_builder/builders/null.rb', line 14 def type @type end |
Instance Method Details
#packer_hash ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/image_builder/builders/null.rb', line 24 def packer_hash hash = {} attr_to_hash(hash, :type, true) attr_to_hash(hash, :name, true) attr_to_hash(hash, :host, true) attr_to_hash(hash, :ssh_username, true) attr_to_hash(hash, :ssh_password) attr_to_hash(hash, :ssh_private_key_file) attr_to_hash(hash, :port) hash end |