Sha256: d52ec3f25491b30b3591176fffdae4ee838ad6eb62a4d635d7e4422571315185

Contents?: true

Size: 551 Bytes

Versions: 229

Compression:

Stored size: 551 Bytes

Contents

module RGen

module Util

module ModelDumper

	def dump(obj=nil)
		obj ||= self
		if obj.is_a?(Array)
			obj.collect {|o| dump(o)}.join("\n\n")
		elsif obj.class.respond_to?(:ecore)
			([obj.to_s] +
			obj.class.ecore.eAllStructuralFeatures.select{|f| !f.many}.collect { |a| 
				"   #{a} => #{obj.getGeneric(a.name)}"
			} +
			obj.class.ecore.eAllStructuralFeatures.select{|f| f.many}.collect { |a|
				"   #{a} => [ #{obj.getGeneric(a.name).join(', ')} ]"
			}).join("\n")
		else
			obj.to_s
		end
	end

end

end

end

Version data entries

229 entries across 229 versions & 3 rubygems

Version Path
puppet-4.9.4-x64-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.4-universal-darwin lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-retrospec-1.3.1 vendor/gems/puppet-4.5.2/lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.3 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.3-x86-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.3-x64-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.3-universal-darwin lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.2 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.2-x86-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.2-x64-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.2-universal-darwin lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.1 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.1-x86-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.1-x64-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.1-universal-darwin lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-retrospec-1.3.0 vendor/gems/puppet-4.5.2/lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.0 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.0-x86-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.0-x64-mingw32 lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb
puppet-4.9.0-universal-darwin lib/puppet/vendor/rgen/lib/rgen/util/model_dumper.rb