Class: Bsdkrun::VolumeInfo

Inherits:
Data
  • Object
show all
Defined in:
lib/bsdkrun/types.rb

Overview

A volume as reported by bsdkrun volume ls --json.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base

Returns:

  • (Object)

    the current value of base



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def base
  @base
end

#created_atObject (readonly)

Returns the value of attribute created_at

Returns:

  • (Object)

    the current value of created_at



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def created_at
  @created_at
end

#guestObject (readonly)

Returns the value of attribute guest

Returns:

  • (Object)

    the current value of guest



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def guest
  @guest
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def path
  @path
end

#sizeObject (readonly)

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def size
  @size
end

#trackedObject (readonly)

Returns the value of attribute tracked

Returns:

  • (Object)

    the current value of tracked



66
67
68
# File 'lib/bsdkrun/types.rb', line 66

def tracked
  @tracked
end

Class Method Details

.from_row(row) ⇒ VolumeInfo

Parameters:

  • row (Hash)

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/bsdkrun/types.rb', line 69

def self.from_row(row)
  created = row["created_at"]
  new(
    name: row["name"].to_s,
    guest: row["guest"],
    base: row["base"],
    path: row["path"].to_s,
    size: row["size"].to_s,
    created_at: created.nil? ? nil : created.to_i,
    tracked: !!row["tracked"]
  )
end