module Viewmatic

Container module for all Viewmatic features.

Constants

VERSION

Library version

Attributes

schemas[R]

@return [Array<Viewmatic::Schema] all schemas loaded from file(s)

Public Class Methods

view(name) click to toggle source

Fetch the first view named “name” from all schemas. If it can't be found an exception is raised.

@return [Viewmatic::View]

# File lib/activerecord-viewmatic.rb, line 23
def self.view(name)
  schema = schemas.detect { |s| s.views.has_key? name }
  schema ? schema.views[name] : raise(ArgumentError, "Could not find view named `#{name}`")
end