Module: WashoutBuilderMethodListHelper

Defined in:
app/helpers/washout_builder_method_list_helper.rb

Overview

helper that is used to list the method's return tyep as a LI element in HTML documentation

Instance Method Summary collapse

Instance Method Details

#create_return_complex_type_list_html(xml, complex_class, builder_out) ⇒ String

this method will create the return type of the method and check if the type is basic or complex type or array of types


12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/washout_builder_method_list_helper.rb', line 12

def create_return_complex_type_list_html(xml, complex_class, builder_out)
  return_content = builder_out[0].multiplied == false ? "#{complex_class}" : "Array of #{complex_class}"
  xml.span('class' => 'pre') do
    xml.a('href' => "##{complex_class}") do |inner_xml|
      inner_xml.span('class' => 'lightBlue') do |y|
        y << "#{return_content}"
      end
    end
  end
end

#create_return_type_list_html(xml, output) ⇒ String

this method will go through each of the arguments print them and then check if we need a spacer after it


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/helpers/washout_builder_method_list_helper.rb', line 34

def create_return_type_list_html(xml, output)
  if output.nil? || output[0].blank?
    xml.span('class' => 'pre') { |sp| sp << 'void' }
  else
    complex_class = output[0].find_complex_class_name
    if WashoutBuilder::Type::BASIC_TYPES.include?(output[0].type)
      xml.span('class' => 'pre') do |inner_xml|
        inner_xml.span('class' => 'blue') do |sp|
          sp << "#{output[0].type}"
        end
      end
    else
      create_return_complex_type_list_html(xml, complex_class, output) unless complex_class.nil?
    end
  end
end