Class: Nvoi::Configuration::ServerVolume
- Inherits:
-
Object
- Object
- Nvoi::Configuration::ServerVolume
- Defined in:
- lib/nvoi/configuration/server.rb
Overview
ServerVolume defines a volume attached to a server
Instance Attribute Summary collapse
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(data = nil) ⇒ ServerVolume
constructor
A new instance of ServerVolume.
Constructor Details
#initialize(data = nil) ⇒ ServerVolume
Returns a new instance of ServerVolume.
9 10 11 12 13 14 |
# File 'lib/nvoi/configuration/server.rb', line 9 def initialize(data = nil) data ||= {} raise ArgumentError, "volume config must be a hash with 'size' key" unless data.is_a?(Hash) @size = data["size"]&.to_i || 10 end |
Instance Attribute Details
#size ⇒ Object
Returns the value of attribute size.
7 8 9 |
# File 'lib/nvoi/configuration/server.rb', line 7 def size @size end |