Module: WashoutBuilderFaultTypeHelper
- Defined in:
- app/helpers/washout_builder_fault_type_helper.rb
Overview
method that is used to show that a method can raise a exception in HTML documentation
Instance Method Summary collapse
-
#create_fault_model_complex_element_type(pre, attr_primitive, attribute, array) ⇒ void
checks if a complex attribute of a complex type SoapFault is array or not if the attribute is an array will print also the type of the elements contained in the array otherwise will show the complex class of the attribute.
-
#create_html_fault_model_element_type(pre, attribute, attr_details) ⇒ String
this method is used to print all attributes of a SoapFault element if the attribute value is a primitve value it will be shown in blue and will also show the type of the primitive if is a complex type will use another method for finding out the complex class.
-
#get_member_type_string(attr_details) ⇒ String
if the attribute is of type array the method identifies the type of the elements inside the array.
-
#get_primitive_type_string(attr_details) ⇒ String
if the attribute value is of type nil the documentation will show string otherwise the primitive value.
-
#member_type_is_basic?(attr_details) ⇒ string
if the attribute is an array this method is used to identify the type of the elements inside the array.
-
#primitive_type_is_basic?(attr_details) ⇒ boolean
checks is the attribute has a primitive value or a complex value.
Instance Method Details
#create_fault_model_complex_element_type(pre, attr_primitive, attribute, array) ⇒ void
This method returns an undefined value.
checks if a complex attribute of a complex type SoapFault is array or not if the attribute is an array will print also the type of the elements contained in the array otherwise will show the complex class of the attribute
14 15 16 17 |
# File 'app/helpers/washout_builder_fault_type_helper.rb', line 14 def create_fault_model_complex_element_type(pre, attr_primitive, attribute, array) attribute_primitive = array == true ? "Array of #{attr_primitive}" : "#{attr_primitive}" pre << "<a href='##{attr_primitive}'><span class='lightBlue'> #{attribute_primitive}</span></a> <span class='bold'>#{attribute}</span>" end |
#create_html_fault_model_element_type(pre, attribute, attr_details) ⇒ String
this method is used to print all attributes of a SoapFault element if the attribute value is a primitve value it will be shown in blue and will also show the type of the primitive if is a complex type will use another method for finding out the complex class
93 94 95 96 97 98 99 |
# File 'app/helpers/washout_builder_fault_type_helper.rb', line 93 def create_html_fault_model_element_type(pre, attribute, attr_details) if primitive_type_is_basic?(attr_details) || attr_details[:primitive] == 'nilclass' pre << "<span class='blue'>#{get_primitive_type_string(attr_details)}</span> <span class='bold'>#{attribute}</span>" else create_fault_model_complex_element_type(pre, get_member_type_string(attr_details), attribute, true) end end |
#get_member_type_string(attr_details) ⇒ String
if the attribute is of type array the method identifies the type of the elements inside the array
@see #member_type_is_basic?
71 72 73 |
# File 'app/helpers/washout_builder_fault_type_helper.rb', line 71 def get_member_type_string(attr_details) attr_details[:primitive].to_s.downcase == 'array' ? member_type_is_basic?(attr_details) : attr_details[:primitive] end |
#get_primitive_type_string(attr_details) ⇒ String
if the attribute value is of type nil the documentation will show string otherwise the primitive value
56 57 58 |
# File 'app/helpers/washout_builder_fault_type_helper.rb', line 56 def get_primitive_type_string(attr_details) attr_details[:primitive].to_s.downcase == 'nilclass' ? 'string' : attr_details[:primitive].to_s.downcase end |
#member_type_is_basic?(attr_details) ⇒ string
if the attribute is an array this method is used to identify the type of the elements inside the array
29 30 31 |
# File 'app/helpers/washout_builder_fault_type_helper.rb', line 29 def member_type_is_basic?(attr_details) WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[:member_type].to_s.downcase) ? attr_details[:member_type].to_s.downcase : attr_details[:member_type] end |
#primitive_type_is_basic?(attr_details) ⇒ boolean
checks is the attribute has a primitive value or a complex value
43 44 45 |
# File 'app/helpers/washout_builder_fault_type_helper.rb', line 43 def primitive_type_is_basic?(attr_details) WashoutBuilder::Type::BASIC_TYPES.include?(attr_details[:primitive].to_s.downcase) end |