Method: Blueprinter::Base.view?

Defined in:
lib/blueprinter/base.rb

.view?(view_name) ⇒ Boolean

Check whether or not a Blueprint supports the supplied view. It accepts a view name.

class ExampleBlueprint < Blueprinter::Base

view :custom do
end

end

ExampleBlueprint.view?(:custom) => true
ExampleBlueprint.view?(:doesnt_exist) => false

supported by this Blueprint.

Examples:

With the following Blueprint


Parameters:

  • view_name (Symbol)

    the view name

Returns:

  • (Boolean)

    a boolean value indicating if the view is



447
448
449
# File 'lib/blueprinter/base.rb', line 447

def self.view?(view_name)
  view_collection.view? view_name
end