Class: AppleData::FactoryDataReset
- Inherits:
-
DataFile
- Object
- DataFile
- AppleData::FactoryDataReset
- Defined in:
- lib/apple_data/factory_data_reset.rb
Overview
Factory Device Restore
Instance Method Summary collapse
- #data ⇒ Object
- #ensure_property(prop) ⇒ Object
-
#initialize ⇒ FactoryDataReset
constructor
A new instance of FactoryDataReset.
Constructor Details
#initialize ⇒ FactoryDataReset
Returns a new instance of FactoryDataReset.
7 8 9 10 11 12 13 |
# File 'lib/apple_data/factory_data_reset.rb', line 7 def initialize super('fdr.yaml') @data ||= {} # : data @data['properties'] = [] # : [property] end |
Instance Method Details
#data ⇒ Object
26 27 28 29 30 |
# File 'lib/apple_data/factory_data_reset.rb', line 26 def data @data['properties'].sort_by! { |prop| prop['name'] } @data end |
#ensure_property(prop) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/apple_data/factory_data_reset.rb', line 15 def ensure_property(prop) prop_instance = @data['properties'].find { |p| p['name'] == prop } unless prop_instance prop_instance = {} # : property prop_instance['name'] = prop prop_instance['description'] = nil @data['properties'] << prop_instance end prop_instance end |