Class: VpsAdminOS::Converter::Vz6::ConfigItem::Device
- Inherits:
-
Struct
- Object
- Struct
- VpsAdminOS::Converter::Vz6::ConfigItem::Device
- Defined in:
- lib/vpsadminos-converter/vz6/config_item.rb
Instance Attribute Summary collapse
-
#major ⇒ Object
Returns the value of attribute major.
-
#minor ⇒ Object
Returns the value of attribute minor.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#major ⇒ Object
Returns the value of attribute major
5 6 7 |
# File 'lib/vpsadminos-converter/vz6/config_item.rb', line 5 def major @major end |
#minor ⇒ Object
Returns the value of attribute minor
5 6 7 |
# File 'lib/vpsadminos-converter/vz6/config_item.rb', line 5 def minor @minor end |
#mode ⇒ Object
Returns the value of attribute mode
5 6 7 |
# File 'lib/vpsadminos-converter/vz6/config_item.rb', line 5 def mode @mode end |
#type ⇒ Object
Returns the value of attribute type
5 6 7 |
# File 'lib/vpsadminos-converter/vz6/config_item.rb', line 5 def type @type end |
Instance Method Details
#to_ct_device ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/vpsadminos-converter/vz6/config_item.rb', line 10 def to_ct_device Devices::Device.new( case type when 'b' 'block' when 'c' 'char' else raise "unsupported device type '#{type}'" end, major, minor, # q is for quota management, not supported in vpsAdminOS mode == 'none' ? '' : mode.gsub('q', '') ) end |
#to_s ⇒ Object
6 7 8 |
# File 'lib/vpsadminos-converter/vz6/config_item.rb', line 6 def to_s "#{type}:#{major}:#{minor}:#{mode}" end |