Class: Mousevc::Model
- Inherits:
-
Object
- Object
- Mousevc::Model
- Defined in:
- lib/mousevc/model.rb
Overview
The base model class for a Mousevc application. Provides access to basic functionality for validating input before modifying data via it’s @validation attribute, an instance of the Mousevc::Validation class.
Instance Attribute Summary collapse
-
#validation ⇒ Mousevc::Validation
readonly
A reference to the model’s validation instance.
Instance Method Summary collapse
-
#clear ⇒ Object
Overridable empty method for clearing data in the model subclass.
-
#initialize(options = {}) ⇒ Model
constructor
Creates a new
Mousevc::Modelinstance.
Constructor Details
#initialize(options = {}) ⇒ Model
Creates a new Mousevc::Model instance
24 25 26 27 |
# File 'lib/mousevc/model.rb', line 24 def initialize(={}) @validation = [:validation] ? [:validation] : Validation.new clear end |
Instance Attribute Details
#validation ⇒ Mousevc::Validation (readonly)
Returns a reference to the model’s validation instance.
16 17 18 |
# File 'lib/mousevc/model.rb', line 16 def validation @validation end |
Instance Method Details
#clear ⇒ Object
Overridable empty method for clearing data in the model subclass
32 33 |
# File 'lib/mousevc/model.rb', line 32 def clear end |