Class: MMMD::Renderers::HTMLConstants::MapManager
- Inherits:
 - 
      Object
      
        
- Object
 - MMMD::Renderers::HTMLConstants::MapManager
 
 
- Defined in:
 - lib/mmmd/renderers/html.rb
 
Overview
Class for managing styles and style overrides
Instance Attribute Summary collapse
- 
  
    
      #mapping  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute mapping.
 
Class Method Summary collapse
- 
  
    
      .define_mapping(key, mapping)  ⇒ void 
    
    
  
  
  
  
  
  
  
  
  
    
Define a default mapping for specified class.
 - 
  
    
      .mapping  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    
Get computed mapping.
 
Instance Method Summary collapse
- 
  
    
      #initialize(overrides)  ⇒ MapManager 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of MapManager.
 
Constructor Details
#initialize(overrides) ⇒ MapManager
Returns a new instance of MapManager.
      127 128 129 130  | 
    
      # File 'lib/mmmd/renderers/html.rb', line 127 def initialize(overrides) @mapping = self.class.mapping @mapping = @mapping.merge(overrides["mapping"]) if overrides["mapping"] end  | 
  
Instance Attribute Details
#mapping ⇒ Object (readonly)
Returns the value of attribute mapping.
      132 133 134  | 
    
      # File 'lib/mmmd/renderers/html.rb', line 132 def mapping @mapping end  | 
  
Class Method Details
.define_mapping(key, mapping) ⇒ void
This method returns an undefined value.
Define a default mapping for specified class
      115 116 117 118  | 
    
      # File 'lib/mmmd/renderers/html.rb', line 115 def define_mapping(key, mapping) @mapping ||= ELEMENT_MAP.dup @mapping[key] = mapping end  | 
  
.mapping ⇒ Hash
Get computed mapping
      122 123 124  | 
    
      # File 'lib/mmmd/renderers/html.rb', line 122 def mapping @mapping ||= ELEMENT_MAP.dup end  |