diff --git a/lib/blueprinter/v2/base.rb b/lib/blueprinter/v2/base.rb index 614365fe..d5ea288d 100644 --- a/lib/blueprinter/v2/base.rb +++ b/lib/blueprinter/v2/base.rb @@ -77,6 +77,22 @@ def self.[](name) children ? view[children] : view end + def self.render(obj, options = {}) + if array_like? obj + render_collection(obj, options) + else + render_object(obj, options) + end + end + + def self.render_object(obj, options = {}) + # TODO call external renderer + end + + def self.render_collection(objs, options = {}) + # TODO call external renderer + end + # Apply partials and field exclusions # @api private def self.eval!(lock = true) @@ -102,9 +118,9 @@ def self.run_eval! @evaled = true end - # Render the object - def self.render(obj, options = {}) - # TODO: call an external Render module/class, passing in self, obj, and options + # @api private + def self.array_like?(obj) + # TODO end end end