Module: Parcel::HasParcel::InstanceMethods
- Defined in:
- lib/parcel/has_parcel.rb
Instance Method Summary collapse
Instance Method Details
#commit_parcels! ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/parcel/has_parcel.rb', line 16 def commit_parcels! Array(instance_variables.select { |v| v =~ /\@_parcel_/ }).each do |name| instance = instance_variable_get(name) instance.commit! if instance end true end |
#destroy_parcels! ⇒ Object
25 26 27 |
# File 'lib/parcel/has_parcel.rb', line 25 def destroy_parcels! FileUtils.rm_rf(self.class.parcel_data_path(".")) end |
#parcel_data_path(filename) ⇒ Object
11 12 13 14 |
# File 'lib/parcel/has_parcel.rb', line 11 def parcel_data_path(filename) data_path = File.join(Parcel.interpolate_path(Parcel.storage_root, Hash.new, self), filename.to_s) data_path end |