Module: JsonToRubyClass

Defined in:
lib/json_to_ruby_class.rb,
lib/json_to_ruby_class/version.rb,
lib/json_to_ruby_class/ruby_converter.rb,
lib/json_to_ruby_class/c_sharp_converter.rb,
lib/json_to_ruby_class/vb_dot_net_converter.rb

Defined Under Namespace

Classes: CSharpConverter, RubyConverter, VBDotNetConverter

Constant Summary collapse

VB_DOT_NET_LANGUAGE_TYPE =
'vb'
C_SHARP_LANGUAGE_TYPE =
'c#'
RUBY_LANGUAGE_TYPE =
'ruby'
VERSION =
"0.2.0"

Class Method Summary collapse

Class Method Details

.produce_models(hash, language = 'ruby') ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/json_to_ruby_class.rb', line 13

def self.produce_models(hash, language = 'ruby')
  models_array = collect_info_from_json(hash, nil)

  case language
   when C_SHARP_LANGUAGE_TYPE then CSharpConverter.prepare_c_sharp_models_from_hash models_array
   when VB_DOT_NET_LANGUAGE_TYPE then VBDotNetConverter.prepare_vb_dot_net_models_from_hash models_array
   else RubyConverter.prepare_ruby_models_from_hash models_array
  end
end