Class: BlkID::PartList
- Inherits:
-
Object
- Object
- BlkID::PartList
- Defined in:
- lib/rblkid/partlist.rb
Instance Method Summary collapse
- #devno_to_partition(devno) ⇒ Object
-
#initialize(struct) ⇒ PartList
constructor
A new instance of PartList.
- #numof_partitions ⇒ Object (also: #size)
- #partition(n) ⇒ Object (also: #[])
- #table ⇒ Object
- #to_ffi ⇒ Object
Constructor Details
#initialize(struct) ⇒ PartList
Returns a new instance of PartList.
26 27 28 |
# File 'lib/rblkid/partlist.rb', line 26 def initialize (struct) @struct = struct end |
Instance Method Details
#devno_to_partition(devno) ⇒ Object
40 41 42 |
# File 'lib/rblkid/partlist.rb', line 40 def devno_to_partition (devno) Partition.new(BlkID::C.blkid_partlist_devno_to_partition(@struct, devno)) end |
#numof_partitions ⇒ Object Also known as: size
35 36 37 |
# File 'lib/rblkid/partlist.rb', line 35 def numof_partitions BlkID::C.blkid_partlist_numof_partitions(@struct) end |
#partition(n) ⇒ Object Also known as: []
30 31 32 |
# File 'lib/rblkid/partlist.rb', line 30 def partition (n) BlkID::C.blkid_partlist_get_partition(@struct, n) end |
#table ⇒ Object
44 45 46 |
# File 'lib/rblkid/partlist.rb', line 44 def table PartTable.new(BlkID::C.blkid_partlist_get_table(@struct)) end |
#to_ffi ⇒ Object
48 49 50 |
# File 'lib/rblkid/partlist.rb', line 48 def to_ffi @struct end |