Class: AppleData::Keybag
Overview
Represents a GID grouping of encrypted and decrypted keybags
Defined Under Namespace
Classes: BoardKeyBag
Instance Attribute Summary collapse
-
#keybags ⇒ Object
readonly
Returns the value of attribute keybags.
Attributes inherited from DataFile
Class Method Summary collapse
Instance Method Summary collapse
- #get_board(board_id) ⇒ Object
-
#initialize(chip_id) ⇒ Keybag
constructor
A new instance of Keybag.
Methods inherited from DataFile
#auto_sort?, #collection, #collections, from_path, #load_file, #metadata, #save!, #sort!, #sort_paths
Constructor Details
#initialize(chip_id) ⇒ Keybag
Returns a new instance of Keybag.
23 24 25 |
# File 'lib/apple_data/keybag.rb', line 23 def initialize(chip_id) super('keybags', chip_id.to_s) end |
Instance Attribute Details
#keybags ⇒ Object (readonly)
Returns the value of attribute keybags.
8 9 10 |
# File 'lib/apple_data/keybag.rb', line 8 def keybags @keybags end |
Class Method Details
.[](chip_id) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/apple_data/keybag.rb', line 14 def self.[](chip_id) chip_id = chip_id.to_i return @keybags[chip_id] if @keybags.key? chip_id instance = allocate instance.send(:initialize, chip_id) @keybags[chip_id] = instance end |
.save_all ⇒ Object
10 11 12 |
# File 'lib/apple_data/keybag.rb', line 10 def self.save_all @keybags.each_value(&:save) end |
Instance Method Details
#get_board(board_id) ⇒ Object
27 28 29 30 31 |
# File 'lib/apple_data/keybag.rb', line 27 def get_board(board_id) board_id = board_id.to_i boards = collection(:keybag_boards) BoardKeyBag.new self, board_id, boards.ensure_key(board_id, description: false) end |