Class: Rumbly::Model::Application

Inherits:
Object
  • Object
show all
Extended by:
Abstract
Defined in:
lib/rumbly/model/application.rb

Overview

This is an abstract class that represents the full model of a MVC application, including all classes and relationships. Object mapper-specific implementations should subclass this class and implement the following methods: name, klasses, and relationships.

Constant Summary collapse

ATTRIBUTES =

Attributes and default values of an Application

{ name: '', klasses: [], relationships: [] }

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Abstract

stub_required_methods

Class Method Details

.createObject

Creates a new subclass of Rumbly::Model::Application based on the options set in the main Rumbly module (via rake, command line, etc.). If the model_type+ option is set to auto, the current object mapper library is auto-detected.



28
29
30
31
32
# File 'lib/rumbly/model/application.rb', line 28

def create
  model_type = auto_detect_model_type
  require "rumbly/model/#{model_type}/application"
  Rumbly::Model.const_get(model_type.to_s.classify)::Application.new
end

Instance Method Details

#klass_by_name(name) ⇒ Object

Returns a Klass object from our cache indexed by name.



54
55
56
# File 'lib/rumbly/model/application.rb', line 54

def klass_by_name (name)
  klass_cache[name]
end