Class: Pvectl::Services::ResizeVolume::ParsedSize

Inherits:
Struct
  • Object
show all
Defined in:
lib/pvectl/services/resize_volume.rb

Overview

Parsed size representation returned by parse_size.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rawString (readonly)

Returns original size string for API (e.g., “+10G”).

Returns:

  • (String)

    original size string for API (e.g., “+10G”)



36
37
38
39
40
41
42
43
# File 'lib/pvectl/services/resize_volume.rb', line 36

ParsedSize = Struct.new(:relative, :value, :raw, keyword_init: true) do
  # Whether this is a relative size (increment).
  #
  # @return [Boolean]
  def relative?
    relative
  end
end

#relativeBoolean (readonly)

Returns true if size is relative (prefixed with +).

Returns:

  • (Boolean)

    true if size is relative (prefixed with +)



36
37
38
39
40
41
42
43
# File 'lib/pvectl/services/resize_volume.rb', line 36

ParsedSize = Struct.new(:relative, :value, :raw, keyword_init: true) do
  # Whether this is a relative size (increment).
  #
  # @return [Boolean]
  def relative?
    relative
  end
end

#valueString (readonly)

Returns clean size value without + prefix (e.g., “10G”).

Returns:

  • (String)

    clean size value without + prefix (e.g., “10G”)



36
37
38
39
40
41
42
43
# File 'lib/pvectl/services/resize_volume.rb', line 36

ParsedSize = Struct.new(:relative, :value, :raw, keyword_init: true) do
  # Whether this is a relative size (increment).
  #
  # @return [Boolean]
  def relative?
    relative
  end
end

Instance Method Details

#relative?Boolean

Whether this is a relative size (increment).

Returns:

  • (Boolean)


40
41
42
# File 'lib/pvectl/services/resize_volume.rb', line 40

def relative?
  relative
end