Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/norma/orm.rb
Instance Method Summary collapse
- #as_record ⇒ Object
- #record_id ⇒ Object
-
#state ⇒ Object
TODO: rename to record_state ? TODO: Add user define include/exlcude of persitant variables.
Instance Method Details
#as_record ⇒ Object
72 73 74 |
# File 'lib/norma/orm.rb', line 72 def as_record @as_record ||= Norma::Record.new(self) end |
#record_id ⇒ Object
76 77 78 |
# File 'lib/norma/orm.rb', line 76 def record_id as_record.id end |
#state ⇒ Object
TODO: rename to record_state ? TODO: Add user define include/exlcude of persitant variables.
82 83 84 85 86 |
# File 'lib/norma/orm.rb', line 82 def state fields = instance_variables - Norma::EXCLUDE_FIELDS values = fields.collect { |v| instance_variable_get(v) } return fields.zip(values) end |