Class: Pod::Installer::ProjectCache::ProjectCacheVersion
- Inherits:
 - 
      Object
      
        
- Object
 - Pod::Installer::ProjectCache::ProjectCacheVersion
 
 
- Defined in:
 - lib/cocoapods/installer/project_cache/project_cache_version.rb
 
Overview
Object that stores, loads, and holds the version of the project cache.
Instance Attribute Summary collapse
- 
  
    
      #version  ⇒ Version 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The version of the project cache.
 
Class Method Summary collapse
- 
  
    
      .from_file(path)  ⇒ ProjectCacheVersion 
    
    
  
  
  
  
  
  
  
  
  
    
Constructs a ProjectCacheVersion from a file.
 
Instance Method Summary collapse
- 
  
    
      #initialize(version = Version.create('0'))  ⇒ ProjectCacheVersion 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initialize a new instance.
 - #save_as(path) ⇒ void
 
Constructor Details
#initialize(version = Version.create('0')) ⇒ ProjectCacheVersion
Initialize a new instance.
      15 16 17  | 
    
      # File 'lib/cocoapods/installer/project_cache/project_cache_version.rb', line 15 def initialize(version = Version.create('0')) @version = version end  | 
  
Instance Attribute Details
#version ⇒ Version (readonly)
Returns The version of the project cache.
      9 10 11  | 
    
      # File 'lib/cocoapods/installer/project_cache/project_cache_version.rb', line 9 def version @version end  | 
  
Class Method Details
.from_file(path) ⇒ ProjectCacheVersion
Constructs a ProjectCacheVersion from a file.
      26 27 28 29 30  | 
    
      # File 'lib/cocoapods/installer/project_cache/project_cache_version.rb', line 26 def self.from_file(path) return ProjectCacheVersion.new unless File.exist?(path) cached_version = Version.create(File.read(path)) ProjectCacheVersion.new(cached_version) end  | 
  
Instance Method Details
#save_as(path) ⇒ void
This method returns an undefined value.
      37 38 39  | 
    
      # File 'lib/cocoapods/installer/project_cache/project_cache_version.rb', line 37 def save_as(path) Sandbox.update_changed_file(path, version.to_s) end  |