Class: Guides::Indexer

Inherits:
Object
  • Object
show all
Defined in:
lib/guides/indexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, warnings, production = false) ⇒ Indexer

Returns a new instance of Indexer.



9
10
11
12
13
14
# File 'lib/guides/indexer.rb', line 9

def initialize(body, warnings, production = false)
  @body     = body
  @result   = @body.dup
  @warnings = warnings
  @production = production
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/guides/indexer.rb', line 7

def body
  @body
end

#level_hashObject (readonly)

Returns the value of attribute level_hash.



7
8
9
# File 'lib/guides/indexer.rb', line 7

def level_hash
  @level_hash
end

#resultObject (readonly)

Returns the value of attribute result.



7
8
9
# File 'lib/guides/indexer.rb', line 7

def result
  @result
end

#warningsObject (readonly)

Returns the value of attribute warnings.



7
8
9
# File 'lib/guides/indexer.rb', line 7

def warnings
  @warnings
end

Instance Method Details

#indexObject



16
17
18
# File 'lib/guides/indexer.rb', line 16

def index
  @level_hash = process(body)
end