washout_builder 0.14.1 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -2
  3. data/.rubocop.yml +68 -0
  4. data/.travis.yml +1 -1
  5. data/Appraisals +9 -1
  6. data/Gemfile +2 -3
  7. data/Rakefile +17 -20
  8. data/app/controllers/washout_builder/washout_builder_controller.rb +79 -79
  9. data/app/helpers/washout_builder_complex_type_helper.rb +16 -23
  10. data/app/helpers/washout_builder_fault_type_helper.rb +12 -13
  11. data/app/helpers/washout_builder_method_arguments_helper.rb +24 -26
  12. data/app/helpers/washout_builder_method_list_helper.rb +16 -11
  13. data/app/helpers/washout_builder_method_return_type_helper.rb +14 -12
  14. data/app/views/wash_with_html/doc.builder +2 -2
  15. data/bin/appraisal +16 -0
  16. data/bin/autospec +16 -0
  17. data/bin/bundler +16 -0
  18. data/bin/cdiff +16 -0
  19. data/bin/coderay +16 -0
  20. data/bin/colortab +16 -0
  21. data/bin/coveralls +16 -0
  22. data/bin/decolor +16 -0
  23. data/bin/erubis +16 -0
  24. data/bin/guard +16 -0
  25. data/bin/htmldiff +16 -0
  26. data/bin/ldiff +16 -0
  27. data/bin/listen +16 -0
  28. data/bin/nokogiri +16 -0
  29. data/bin/phare +16 -0
  30. data/bin/pry +16 -0
  31. data/bin/rackup +16 -0
  32. data/bin/rails +16 -0
  33. data/bin/rake +16 -0
  34. data/bin/restclient +16 -0
  35. data/bin/rspec +16 -0
  36. data/bin/rubocop +16 -0
  37. data/bin/ruby-parse +16 -0
  38. data/bin/ruby-rewrite +16 -0
  39. data/bin/sass +16 -0
  40. data/bin/sass-convert +16 -0
  41. data/bin/scss +16 -0
  42. data/bin/scss-lint +16 -0
  43. data/bin/term_display +16 -0
  44. data/bin/term_mandel +16 -0
  45. data/bin/thor +16 -0
  46. data/bin/uuid +16 -0
  47. data/config/routes.rb +3 -3
  48. data/init.rb +1 -1
  49. data/lib/washout_builder.rb +20 -29
  50. data/lib/washout_builder/document/complex_type.rb +70 -75
  51. data/lib/washout_builder/document/exception_model.rb +46 -51
  52. data/lib/washout_builder/document/generator.rb +56 -66
  53. data/lib/washout_builder/document/shared_complex_type.rb +2 -4
  54. data/lib/washout_builder/engine.rb +1 -2
  55. data/lib/washout_builder/soap.rb +6 -10
  56. data/lib/washout_builder/type.rb +9 -23
  57. data/lib/washout_builder/version.rb +5 -5
  58. data/spec/app/controllers/washout_builder_controller_spec.rb +26 -28
  59. data/spec/app/helpers/washout_builder_complex_type_helper_spec.rb +37 -45
  60. data/spec/app/helpers/washout_builder_fault_type_helper_spec.rb +65 -77
  61. data/spec/app/helpers/washout_builder_method_arguments_helper_spec.rb +65 -76
  62. data/spec/app/helpers/washout_builder_method_list_helper_spec.rb +30 -35
  63. data/spec/app/helpers/washout_builder_method_return_type_helper_spec.rb +25 -27
  64. data/spec/dummy/config/application.rb +4 -4
  65. data/spec/dummy/config/boot.rb +1 -1
  66. data/spec/dummy/config/environments/development.rb +2 -3
  67. data/spec/dummy/config/environments/test.rb +3 -3
  68. data/spec/dummy/config/initializers/secret_token.rb +1 -1
  69. data/spec/dummy/config/initializers/session_store.rb +1 -1
  70. data/spec/dummy/config/routes.rb +0 -1
  71. data/spec/dummy/script/rails +2 -2
  72. data/spec/integration/washout_builder_all_services_spec.rb +2 -5
  73. data/spec/integration/washout_builder_service_spec.rb +2 -5
  74. data/spec/lib/washout_builder/document/complex_type_spec.rb +98 -118
  75. data/spec/lib/washout_builder/document/exception_model_spec.rb +49 -54
  76. data/spec/lib/washout_builder/document/generator_spec.rb +93 -118
  77. data/spec/lib/washout_builder/type_spec.rb +17 -29
  78. data/spec/lib/washout_builder_spec.rb +293 -308
  79. data/spec/spec_helper.rb +24 -30
  80. data/spec/support/complex_types/fluffy.rb +3 -3
  81. data/spec/support/complex_types/fluffy_container.rb +3 -3
  82. data/spec/support/complex_types/project_type.rb +4 -5
  83. data/spec/support/complex_types/test_type.rb +4 -4
  84. data/washout_builder.gemspec +5 -2
  85. metadata +78 -3
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rails' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('railties', 'rails')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'restclient' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rest-client', 'restclient')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rubocop' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rubocop', 'rubocop')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ruby-parse' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('parser', 'ruby-parse')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ruby-rewrite' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('parser', 'ruby-rewrite')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'sass' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('sass', 'sass')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'sass-convert' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('sass', 'sass-convert')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'scss' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('sass', 'scss')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'scss-lint' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('scss-lint', 'scss-lint')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'term_display' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('term-ansicolor', 'term_display')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'term_mandel' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('term-ansicolor', 'term_mandel')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('thor', 'thor')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'uuid' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('uuid', 'uuid')
@@ -1,4 +1,4 @@
1
1
  WashoutBuilder::Engine.routes.draw do
2
- root :to =>"washout_builder#all"
3
- match '/*name' => "washout_builder#all", :as => :washout_builder_service, :via => :get
4
- end
2
+ root to: 'washout_builder#all'
3
+ match '/*name' => 'washout_builder#all', :as => :washout_builder_service, :via => :get
4
+ end
data/init.rb CHANGED
@@ -1 +1 @@
1
- require 'washout_builder'
1
+ require 'washout_builder'
@@ -1,23 +1,20 @@
1
1
  require 'wash_out'
2
- Gem.find_files("washout_builder/**/*.rb").each { |path| require path }
2
+ Gem.find_files('washout_builder/**/*.rb').each { |path| require path }
3
3
 
4
4
  WashOut::Param.send :include, WashoutBuilder::Document::ComplexType
5
5
 
6
-
7
- WashoutBuilder::Type.get_fault_classes.each do |exception_class|
6
+ WashoutBuilder::Type.all_fault_classes.each do |exception_class|
8
7
  exception_class.class_eval do
9
8
  extend WashoutBuilder::Document::ExceptionModel
10
9
  end
11
10
  end
12
11
 
13
-
14
12
  if defined?(WashOut::SOAP)
15
13
  WashOut::SOAP::ClassMethods.class_eval do
16
14
  alias_method :original_soap_action, :soap_action
17
15
  end
18
16
  end
19
17
 
20
-
21
18
  if defined?(WashOut::Rails::Controller)
22
19
  WashOut::Rails::Controller::ClassMethods.class_eval do
23
20
  alias_method :original_soap_action, :soap_action
@@ -26,28 +23,25 @@ end
26
23
 
27
24
  if defined?(WashOut::SoapConfig)
28
25
  WashOut::SoapConfig.class_eval do
29
- self.singleton_class.send(:alias_method, :original_config, :config)
30
- self.singleton_class.send(:alias_method, :original_keys, :keys)
31
-
26
+ singleton_class.send(:alias_method, :original_config, :config)
27
+ singleton_class.send(:alias_method, :original_keys, :keys)
28
+
32
29
  def self.keys
33
30
  @keys = config.keys
34
31
  end
35
-
32
+
36
33
  def self.config
37
- original_config.merge({description: nil})
34
+ original_config.merge(description: nil)
38
35
  end
39
-
40
36
  end
41
37
  WashOut::SoapConfig.soap_accessor(:description)
42
38
  end
43
39
 
44
-
45
40
  WashOut::Param.class_eval do
46
-
47
41
  def self.parse_builder_def(soap_config, definition)
48
- raise RuntimeError, "[] should not be used in your params. Use nil if you want to mark empty set." if definition == []
49
- return [] if definition == nil
50
-
42
+ raise '[] should not be used in your params. Use nil if you want to mark empty set.' if definition == []
43
+ return [] if definition.nil?
44
+
51
45
  # the following lines was removed because when generating the documentation
52
46
  # the "source_class" attrtibute of the object was not the name of the class of the complex tyoe
53
47
  # but instead was the name given in the hash
@@ -58,32 +52,29 @@ WashOut::Param.class_eval do
58
52
  # :description => :string,
59
53
  # :users => [{:mail => :string }],
60
54
  # }
61
- #end
62
- #
55
+ # end
56
+ #
63
57
  # The name of the complex type should be ProjectType and not "project"
64
-
65
-
58
+
66
59
  # if definition.is_a?(Class) && definition.ancestors.include?(WashOut::Type)
67
60
  # definition = definition.wash_out_param_map
68
61
  # end
69
-
70
- definition = { :value => definition } unless definition.is_a?(Hash) # for arrays and symbols
71
-
72
- definition.collect do |name, opt|
62
+
63
+ definition = { value: definition } unless definition.is_a?(Hash) # for arrays and symbols
64
+
65
+ definition.map do |name, opt|
73
66
  if opt.is_a? WashOut::Param
74
67
  opt
75
68
  elsif opt.is_a? Array
76
69
  WashOut::Param.new(soap_config, name, opt[0], true)
77
70
  else
78
71
  WashOut::Param.new(soap_config, name, opt)
79
- end
80
72
  end
81
73
  end
82
-
74
+ end
83
75
  end
84
-
85
- ActionController::Base.class_eval do
86
76
 
77
+ ActionController::Base.class_eval do
87
78
  # Define a SOAP service. The function has no required +options+:
88
79
  # but allow any of :parser, :namespace, :wsdl_style, :snakecase_input,
89
80
  # :camelize_wsdl, :wsse_username, :wsse_password and :catch_xml_errors.
@@ -91,7 +82,7 @@ ActionController::Base.class_eval do
91
82
  # Any of the the params provided allows for overriding the defaults
92
83
  # (like supporting multiple namespaces instead of application wide such)
93
84
  #
94
- def self.soap_service(options={})
85
+ def self.soap_service(options = {})
95
86
  include WashoutBuilder::SOAP
96
87
  self.soap_config = options
97
88
  end
@@ -1,124 +1,119 @@
1
- require_relative "./shared_complex_type"
1
+ require_relative './shared_complex_type'
2
2
  module WashoutBuilder
3
3
  module Document
4
4
  module ComplexType
5
5
  extend ActiveSupport::Concern
6
6
  include WashoutBuilder::Document::SharedComplexType
7
-
8
-
9
- def get_complex_class_name(defined = [])
10
- complex_class = struct? ? basic_type.gsub(".","/").camelize : nil
11
-
12
- unless complex_class.nil? || defined.blank?
13
-
14
- complex_obj_found = defined.detect {|hash| hash[:class] == complex_class}
15
-
16
- if !complex_obj_found.nil? && struct? && !classified?
17
- raise RuntimeError, "Duplicate use of `#{basic_type}` type name. Consider using classified types."
18
- end
19
- end
20
-
7
+
8
+ def find_complex_class_name(defined = [])
9
+ complex_class = struct? ? basic_type.gsub('.', '/').camelize : nil
10
+ check_duplicate_complex_class(defined, complex_class) unless complex_class.nil? || defined.blank?
21
11
  complex_class
22
12
  end
23
-
24
-
13
+
14
+ def check_duplicate_complex_class(defined, complex_class)
15
+ complex_obj_found = defined.find { |hash| hash[:class] == complex_class }
16
+ raise "Duplicate use of `#{basic_type}` type name. Consider using classified types." if !complex_obj_found.nil? && struct? && !classified?
17
+ end
18
+
25
19
  def complex_type_ancestors(config, complex_class, defined)
26
- classified? ? get_class_ancestors(config, complex_class, defined) : nil
20
+ classified? ? get_class_ancestors(config, complex_class, defined) : nil
27
21
  end
28
-
29
-
30
- def get_param_structure
31
- map.inject({}) {|h,element| h[element.name] = element.type;h }
22
+
23
+ def find_param_structure
24
+ map.each_with_object({}) do|item, memo|
25
+ memo[item.name] = item.type
26
+ memo
27
+ end
32
28
  end
33
-
34
-
35
- def remove_type_inheritable_elements( keys)
36
- self.map = self.map.delete_if{|element| keys.include?(element.name) }
29
+
30
+ def remove_type_inheritable_elements(keys)
31
+ self.map = map.delete_if { |element| keys.include?(element.name) }
37
32
  end
38
-
33
+
39
34
  # def get_ancestor_structure
40
35
  # {self.class.to_s.downcase => self.class.columns_hash.inject({}) {|h, (k,v)| h["#{k}"]="#{v.type}".to_sym; h } }
41
36
  # end
42
-
43
-
37
+
44
38
  def fix_descendant_wash_out_type(config, complex_class)
45
- param_class = complex_class.is_a?(Class) ? complex_class : complex_class.constantize rescue nil
46
- if param_class.present? && param_class.ancestors.include?(WashOut::Type) && map[0].present?
47
- descendant = WashOut::Param.parse_builder_def(config, param_class.wash_out_param_map)[0]
48
- self.name = descendant.name
49
- self.map = descendant.map
39
+ param_class = begin
40
+ complex_class.is_a?(Class) ? complex_class : complex_class.constantize
41
+ rescue
42
+ nil
50
43
  end
44
+ return unless param_class.present? && param_class.ancestors.include?(WashOut::Type) && map[0].present?
45
+ descendant = WashOut::Param.parse_builder_def(config, param_class.wash_out_param_map)[0]
46
+ self.name = descendant.name
47
+ self.map = descendant.map
51
48
  end
52
-
53
-
54
- def same_structure_as_ancestor?(ancestor)
55
- param_structure = get_param_structure
56
- ancestor_structure = ancestor.get_param_structure
57
- if param_structure.keys == ancestor_structure.keys
49
+
50
+ def same_structure_as_ancestor?(ancestor)
51
+ param_structure = find_param_structure
52
+ ancestor_structure = ancestor.find_param_structure
53
+ if param_structure.keys == ancestor_structure.keys
58
54
  return true
59
- else
60
- remove_type_inheritable_elements( ancestor_structure.keys)
55
+ else
56
+ remove_type_inheritable_elements(ancestor_structure.keys)
61
57
  return false
62
58
  end
63
59
  end
64
-
65
-
60
+
66
61
  def get_ancestors(class_name)
67
- param_class = class_name.is_a?(Class) ? class_name : class_name.constantize rescue nil
68
- if param_class.nil?
62
+ param_class = begin
63
+ class_name.is_a?(Class) ? class_name : class_name.constantize
64
+ rescue
65
+ nil
66
+ end
67
+ if param_class.nil?
69
68
  return nil
70
69
  else
71
- get_complex_type_ancestors(param_class, ["ActiveRecord::Base", "Object", "BasicObject", "WashOut::Type" ])
70
+ get_complex_type_ancestors(param_class, ['ActiveRecord::Base', 'Object', 'BasicObject', 'WashOut::Type'])
72
71
  end
73
72
  end
74
-
75
-
76
- def complex_type_descendants(config,defined)
73
+
74
+ def complex_type_descendants(config, defined)
77
75
  if struct?
78
76
  c_names = []
79
- map.each { |obj| c_names.concat(obj.get_nested_complex_types(config, defined)) }
77
+ map.each { |obj| c_names.concat(obj.get_nested_complex_types(config, defined)) }
80
78
  defined.concat(c_names)
81
79
  end
82
80
  defined
83
81
  end
84
-
85
-
86
- def get_nested_complex_types(config,defined)
82
+
83
+ def get_nested_complex_types(config, defined)
87
84
  defined = [] if defined.blank?
88
- complex_class = get_complex_class_name( defined)
89
- fix_descendant_wash_out_type( config, complex_class)
85
+ complex_class = find_complex_class_name(defined)
86
+ fix_descendant_wash_out_type(config, complex_class)
90
87
  unless complex_class.nil?
91
88
  defined << complex_type_hash(complex_class, self, complex_type_ancestors(config, complex_class, defined))
92
89
  end
93
90
  defined = complex_type_descendants(config, defined)
94
91
  defined.sort_by { |hash| hash[:class].to_s.downcase }.uniq unless defined.blank?
95
92
  end
96
-
97
-
93
+
98
94
  def ancestor_structure(ancestors)
99
95
  { ancestors[0].to_s.downcase => ancestors[0].wash_out_param_map }
100
96
  end
101
-
97
+
102
98
  def complex_type_hash(class_name, object, ancestors)
103
- {:class =>class_name, :obj =>object , :ancestors => ancestors }
99
+ {
100
+ 'class' => class_name,
101
+ obj: object,
102
+ ancestors: ancestors
103
+ }
104
104
  end
105
-
106
-
107
- def get_class_ancestors( config, class_name, defined)
108
- bool_the_same = false
109
- ancestors = get_ancestors(class_name)
110
- unless ancestors.blank?
111
- ancestor_object = WashOut::Param.parse_def(config,ancestor_structure(ancestors))[0]
112
- bool_the_same = same_structure_as_ancestor?( ancestor_object)
113
- unless bool_the_same
114
- top_ancestors = get_class_ancestors(config, ancestors[0], defined)
115
- defined << complex_type_hash(ancestors[0],ancestor_object , top_ancestors)
116
- end
117
- ancestors unless bool_the_same
105
+
106
+ def get_class_ancestors(config, class_name, defined)
107
+ ancestors = get_ancestors(class_name)
108
+ return if ancestors.blank?
109
+ ancestor_object = WashOut::Param.parse_def(config, ancestor_structure(ancestors))[0]
110
+ bool_the_same = same_structure_as_ancestor?(ancestor_object)
111
+ unless bool_the_same
112
+ top_ancestors = get_class_ancestors(config, ancestors[0], defined)
113
+ defined << complex_type_hash(ancestors[0], ancestor_object, top_ancestors)
118
114
  end
115
+ ancestors unless bool_the_same
119
116
  end
120
-
121
-
122
117
  end
123
118
  end
124
119
  end