Module: WashoutBuilderComplexTypeHelper

Defined in:
app/helpers/washout_builder_complex_type_helper.rb

Instance Method Summary collapse

Instance Method Details

#create_complex_element_type_html(pre, element) ⇒ Object



15
16
17
18
19
20
21
# File 'app/helpers/washout_builder_complex_type_helper.rb', line 15

def create_complex_element_type_html(pre, element)
  complex_class = element.get_complex_class_name
  unless  complex_class.nil?
    complex_class_content =  element.multiplied == false ? "#{complex_class}" : "Array of #{complex_class}"
    pre << "<a href='##{complex_class}'><span class='lightBlue'>#{complex_class_content}</span></a>&nbsp;<span class='bold'>#{element.name}</span>"
  end
end

#create_element_type_html(pre, element) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/helpers/washout_builder_complex_type_helper.rb', line 4

def create_element_type_html(pre, element)
  element.type = "string" if element.type == "text"
  element.type = "integer" if element.type == "int"
   if WashoutBuilder::Type::BASIC_TYPES.include?(element.type)
      pre << "<span class='blue'>#{element.type}</span>&nbsp;<span class='bold'>#{element.name}</span>"
    else
      create_complex_element_type_html(pre, element)
    end
end