Class: Source2MD::Generator
- Inherits:
- 
      Object
      
        - Object
- Source2MD::Generator
 
- Defined in:
- lib/source2md/generator.rb
Instance Attribute Summary collapse
- 
  
    
      #params  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute params. 
Instance Method Summary collapse
- #call ⇒ Object
- 
  
    
      #initialize(params = {})  ⇒ Generator 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Generator. 
- #to_md ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Generator
Returns a new instance of Generator.
| 5 6 7 | # File 'lib/source2md/generator.rb', line 5 def initialize(params = {}) @params = params end | 
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
| 3 4 5 | # File 'lib/source2md/generator.rb', line 3 def params @params end | 
Instance Method Details
#call ⇒ Object
| 9 10 11 12 | # File 'lib/source2md/generator.rb', line 9 def call output_file.write(to_md) puts "write: #{output_file}" end | 
#to_md ⇒ Object
| 14 15 16 17 18 | # File 'lib/source2md/generator.rb', line 14 def to_md s = sections.collect(&:to_md) * "\n\n" s = TextHelper.blank_lines_squish(s) s = TextHelper.add_newline_at_end_of_text(s) end |