Method: Blueprinter::Reflection#reflections
- Defined in:
- lib/blueprinter/reflection.rb
#reflections ⇒ Hash<Symbol, Blueprinter::Reflection::View>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a Hash of views keyed by name.
Example:
widget_view = WidgetBlueprint.reflections[:default]
category = widget_view.associations[:category]
category.blueprint
=> CategoryBlueprint
category.view
=> :default
25 26 27 28 29 |
# File 'lib/blueprinter/reflection.rb', line 25 def reflections @_reflections ||= view_collection.views.transform_values do |view| View.new(view.name, view_collection) end end |