Class: ActiveGraph::Shared::FilteredHash
- Inherits:
 - 
      Object
      
        
- Object
 - ActiveGraph::Shared::FilteredHash
 
 
- Defined in:
 - lib/active_graph/shared/filtered_hash.rb
 
Defined Under Namespace
Classes: InvalidHashFilterType
Constant Summary collapse
- VALID_SYMBOL_INSTRUCTIONS =
 [:all, :none]
- VALID_HASH_INSTRUCTIONS =
 [:on]
- VALID_INSTRUCTIONS_TYPES =
 [Hash, Symbol]
Instance Attribute Summary collapse
- 
  
    
      #base  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute base.
 - 
  
    
      #instructions  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute instructions.
 - 
  
    
      #instructions_type  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute instructions_type.
 
Instance Method Summary collapse
- #filtered_base ⇒ Object
 - 
  
    
      #initialize(base, instructions)  ⇒ FilteredHash 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of FilteredHash.
 
Constructor Details
#initialize(base, instructions) ⇒ FilteredHash
Returns a new instance of FilteredHash.
      10 11 12 13 14 15  | 
    
      # File 'lib/active_graph/shared/filtered_hash.rb', line 10 def initialize(base, instructions) @base = base @instructions = instructions @instructions_type = instructions.class validate_instructions!(instructions) end  | 
  
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
      8 9 10  | 
    
      # File 'lib/active_graph/shared/filtered_hash.rb', line 8 def base @base end  | 
  
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
      8 9 10  | 
    
      # File 'lib/active_graph/shared/filtered_hash.rb', line 8 def instructions @instructions end  | 
  
#instructions_type ⇒ Object (readonly)
Returns the value of attribute instructions_type.
      8 9 10  | 
    
      # File 'lib/active_graph/shared/filtered_hash.rb', line 8 def instructions_type @instructions_type end  | 
  
Instance Method Details
#filtered_base ⇒ Object
      17 18 19 20 21 22 23 24  | 
    
      # File 'lib/active_graph/shared/filtered_hash.rb', line 17 def filtered_base case instructions when Symbol filtered_base_by_symbol when Hash filtered_base_by_hash end end  |