Module: Viewmatic
- Defined in:
- lib/activerecord-viewmatic.rb,
lib/viewmatic/view.rb,
lib/viewmatic/model.rb,
lib/viewmatic/schema.rb,
lib/viewmatic/railtie.rb,
lib/viewmatic/version.rb,
lib/viewmatic/migration.rb,
lib/viewmatic/schema_statements.rb
Overview
Container module for all Viewmatic features.
Defined Under Namespace
Modules: Migration, Model, SchemaStatements Classes: Railtie, Schema, View
Constant Summary collapse
- VERSION =
Library version
'0.3.0'.freeze
Class Attribute Summary collapse
-
.schemas ⇒ Array<Viewmatic::Schema] all schemas loaded from file(s)
readonly
Array<Viewmatic::Schema] all schemas loaded from file(s).
Class Method Summary collapse
-
.view(name) ⇒ Viewmatic::View
Fetch the first view named “name” from all schemas.
Class Attribute Details
.schemas ⇒ Array<Viewmatic::Schema] all schemas loaded from file(s) (readonly)
Returns Array<Viewmatic::Schema] all schemas loaded from file(s).
14 15 16 |
# File 'lib/activerecord-viewmatic.rb', line 14 def schemas @schemas end |
Class Method Details
.view(name) ⇒ Viewmatic::View
Fetch the first view named “name” from all schemas. If it can’t be found an exception is raised.
23 24 25 26 |
# 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 |