Module: WashoutBuilderMethodArgumentsHelper

Defined in:
app/helpers/washout_builder_method_arguments_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_argument_element_spacer(xml, j, mlen) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/washout_builder_method_arguments_helper.rb', line 17

def create_argument_element_spacer(xml, j, mlen )
  if j< (mlen-1)
    xml.span ", "
  end
  if mlen > 1
    xml.br
  end
  if (j+1) == mlen
    xml.span("class" => "bold") {|y|  y << ")" }
  end
end

#create_html_public_method_arguments(xml, pre, input) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'app/helpers/washout_builder_method_arguments_helper.rb', line 31

def create_html_public_method_arguments(xml, pre, input)
  mlen = input.size
  xml.br if mlen > 1
  if mlen > 0
    input.each_with_index do |element, index|
      create_method_argument_element( pre, element, mlen)
      create_argument_element_spacer(xml, index, mlen )
    end
  end
end

#create_method_argument_element(pre, param, mlen) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/washout_builder_method_arguments_helper.rb', line 3

def create_method_argument_element( pre, param, mlen)
  spacer = "&nbsp;&nbsp;&nbsp;&nbsp;"
  complex_class = param.get_complex_class_name  
  use_spacer =  mlen > 1 ? true : false
  if WashoutBuilder::Type::BASIC_TYPES.include?(param.type)
    pre << "#{use_spacer ? spacer: ''}<span class='blue'>#{param.type}</span>&nbsp;<span class='bold'>#{param.name}</span>"
  else
    unless complex_class.nil?
      argument_content = param.multiplied == false ? "#{complex_class}" : "Array of #{complex_class}"
      pre << "#{use_spacer ? spacer: ''}<a href='##{complex_class}'><span class='lightBlue'>#{argument_content}</span></a>&nbsp;<span class='bold'>#{param.name}</span>"
    end
  end
end