Class: ActiveFedora::Checksum
- Inherits:
 - 
      Object
      
        
- Object
 - ActiveFedora::Checksum
 
 
- Defined in:
 - lib/active_fedora/checksum.rb
 
Instance Attribute Summary collapse
- 
  
    
      #algorithm  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute algorithm.
 - 
  
    
      #uri  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute uri.
 - 
  
    
      #value  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute value.
 
Instance Method Summary collapse
- 
  
    
      #initialize(file)  ⇒ Checksum 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Checksum.
 
Constructor Details
#initialize(file) ⇒ Checksum
Returns a new instance of Checksum.
      5 6 7 8 9 10  | 
    
      # File 'lib/active_fedora/checksum.rb', line 5 def initialize(file) @uri = file.digest.first return unless @uri @algorithm, @value = @uri.path.split(":") @algorithm.upcase! end  | 
  
Instance Attribute Details
#algorithm ⇒ Object (readonly)
Returns the value of attribute algorithm.
      3 4 5  | 
    
      # File 'lib/active_fedora/checksum.rb', line 3 def algorithm @algorithm end  | 
  
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
      3 4 5  | 
    
      # File 'lib/active_fedora/checksum.rb', line 3 def uri @uri end  | 
  
#value ⇒ Object (readonly)
Returns the value of attribute value.
      3 4 5  | 
    
      # File 'lib/active_fedora/checksum.rb', line 3 def value @value end  |