Class: Specdown::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/specdown/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(readme, lookups = {}) ⇒ Parser

Returns a new instance of Parser.



7
8
9
10
# File 'lib/specdown/parser.rb', line 7

def initialize(readme, lookups={})
  @readme   = readme
  @lookups  = lookups
end

Class Method Details

.parse(readme, lookups = {}) ⇒ Object



3
4
5
# File 'lib/specdown/parser.rb', line 3

def self.parse(readme, lookups={})
  self.new(readme, lookups).parse
end

Instance Method Details

#parseObject



12
13
14
15
# File 'lib/specdown/parser.rb', line 12

def parse
  kramdown = Kramdown::Document.new @readme, :input => "GithubMarkdown"
  build_tree kramdown.root.children
end