Module: CsvRowModel::Model::Base
- Extended by:
- ActiveSupport::Concern
- Included in:
- CsvRowModel::Model
- Defined in:
- lib/csv_row_model/model/base.rb
Instance Attribute Summary collapse
-
#initialized_at ⇒ DateTime
readonly
Return when self has been intialized.
-
#parent ⇒ Model
readonly
Return the parent, if this instance is a child.
Class Method Summary collapse
-
.csv_string_model(&block) ⇒ Object
protected
Called to add validations to the csv_string_model_class.
-
.csv_string_model_class ⇒ Class
The Class with validations of the csv_string_model.
Instance Method Summary collapse
-
#abort? ⇒ Boolean
Safe to override.
- #initialize(source = nil, options = {}) ⇒ Object
-
#skip? ⇒ Boolean
Safe to override.
Instance Attribute Details
#initialized_at ⇒ DateTime (readonly)
Return when self has been intialized
11 12 13 |
# File 'lib/csv_row_model/model/base.rb', line 11 def initialized_at @initialized_at end |
#parent ⇒ Model (readonly)
Return the parent, if this instance is a child
8 9 10 |
# File 'lib/csv_row_model/model/base.rb', line 8 def parent @parent end |
Class Method Details
.csv_string_model(&block) ⇒ Object (protected)
Called to add validations to the csv_string_model_class
46 47 48 |
# File 'lib/csv_row_model/model/base.rb', line 46 def csv_string_model(&block) csv_string_model_class.class_eval(&block) end |
.csv_string_model_class ⇒ Class
Returns the Class with validations of the csv_string_model.
40 41 42 |
# File 'lib/csv_row_model/model/base.rb', line 40 def csv_string_model_class @csv_string_model_class ||= inherited_custom_class(:csv_string_model_class, CsvStringModel) end |
Instance Method Details
#abort? ⇒ Boolean
Safe to override.
34 35 36 |
# File 'lib/csv_row_model/model/base.rb', line 34 def abort? false end |
#initialize(source = nil, options = {}) ⇒ Object
19 20 21 22 |
# File 'lib/csv_row_model/model/base.rb', line 19 def initialize(source=nil, ={}) @initialized_at = DateTime.now @parent = [:parent] end |
#skip? ⇒ Boolean
Safe to override.
27 28 29 |
# File 'lib/csv_row_model/model/base.rb', line 27 def skip? !valid? end |