Class: Generators::HtmlClass

Inherits:
ContextUser
  • Object
show all
Defined in:
lib/tap/support/tdoc/tdoc_html_generator.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#tdoc_original_value_hashObject



11
# File 'lib/tap/support/tdoc/tdoc_html_generator.rb', line 11

alias tdoc_original_value_hash value_hash

#value_hashObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/tap/support/tdoc/tdoc_html_generator.rb', line 13

def value_hash
  # split attributes into configurations and regular attributes
  configurations, attributes = @context.attributes.partition do |attribute|
    attribute.kind_of?(Tap::Support::TDoc::ConfigAttr)
  end
  
  # set the context attributes to JUST the regular 
  # attributes and process as usual.
  @context.attributes.clear.concat attributes
  values = tdoc_original_value_hash
  
  # set the context attributes to the configurations
  # and echo the regular processing to produce a list
  # of configurations
  @context.attributes.clear.concat configurations
  @context.sections.each_with_index do |section, i|
    secdata = values["sections"][i]
 
    al = build_attribute_list(section)
    secdata["configurations"] = al unless al.empty?
  end 

  values
end