Class: DigitalOceanInventory::Host
- Inherits:
-
Object
- Object
- DigitalOceanInventory::Host
- Defined in:
- lib/digital_ocean_inventory/host.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#droplet ⇒ Object
readonly
Returns the value of attribute droplet.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, droplet, config) ⇒ Host
constructor
A new instance of Host.
- #vars ⇒ Object
Constructor Details
#initialize(name, droplet, config) ⇒ Host
Returns a new instance of Host.
14 15 16 17 18 |
# File 'lib/digital_ocean_inventory/host.rb', line 14 def initialize(name, droplet, config) @name = name @droplet = droplet @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/digital_ocean_inventory/host.rb', line 5 def config @config end |
#droplet ⇒ Object (readonly)
Returns the value of attribute droplet.
5 6 7 |
# File 'lib/digital_ocean_inventory/host.rb', line 5 def droplet @droplet end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/digital_ocean_inventory/host.rb', line 5 def name @name end |
Class Method Details
.build(opts = {}) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/digital_ocean_inventory/host.rb', line 7 def self.build(opts = {}) config = opts[:config] droplet = opts[:droplet] new droplet.name, droplet, config end |
Instance Method Details
#vars ⇒ Object
20 21 22 23 24 25 |
# File 'lib/digital_ocean_inventory/host.rb', line 20 def vars return @_vars if defined? @_vars @_vars = host_vars.to_h @_vars end |