Class: ActiveStorage::Attached
- Inherits:
 - 
      Object
      
        
- Object
 - ActiveStorage::Attached
 
 
- Defined in:
 - lib/active_storage/attached.rb
 
Overview
Abstract base class for the concrete ActiveStorage::Attached::One and ActiveStorage::Attached::Many classes that both provide proxy access to the blob association for a record.
Defined Under Namespace
Modules: Macros Classes: Many, One
Instance Attribute Summary collapse
- 
  
    
      #dependent  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute dependent.
 - 
  
    
      #name  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute name.
 - 
  
    
      #record  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute record.
 
Instance Method Summary collapse
- 
  
    
      #initialize(name, record, dependent:)  ⇒ Attached 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Attached.
 
Constructor Details
#initialize(name, record, dependent:) ⇒ Attached
Returns a new instance of Attached.
      13 14 15  | 
    
      # File 'lib/active_storage/attached.rb', line 13 def initialize(name, record, dependent:) @name, @record, @dependent = name, record, dependent end  | 
  
Instance Attribute Details
#dependent ⇒ Object (readonly)
Returns the value of attribute dependent.
      11 12 13  | 
    
      # File 'lib/active_storage/attached.rb', line 11 def dependent @dependent end  | 
  
#name ⇒ Object (readonly)
Returns the value of attribute name.
      11 12 13  | 
    
      # File 'lib/active_storage/attached.rb', line 11 def name @name end  | 
  
#record ⇒ Object (readonly)
Returns the value of attribute record.
      11 12 13  | 
    
      # File 'lib/active_storage/attached.rb', line 11 def record @record end  |