# File lib/rabl/partials.rb, line 23 def object_to_hash(object, options={}, &block) return object unless is_object?(object) || is_collection?(object) return [] if is_collection?(object) && object.blank? # empty collection engine_options = options.reverse_merge(:format => "hash", :view_path => @_view_path, :root => (options[:root] || false)) Rabl::Engine.new(options[:source], engine_options).render(@_scope, :object => object, &block) end