Class: ActiveRecord::TablelessModel

Inherits:
Hash
  • Object
show all
Extended by:
Tableless::ClassMethods
Includes:
Tableless::InstanceMethods, Validatable
Defined in:
lib/tableless_model.rb

Overview

TablelessModel class is basically an Hash with method-like keys that must be defined in advance as for an ActiveRecord model, but without a table. Trying to set new keys not defined at class level result in NoMethodError raised

Class Attribute Summary collapse

Instance Attribute Summary collapse

Method Summary

Methods included from Tableless::ClassMethods

attribute, cast, inherited

Methods included from Tableless::InstanceMethods

#[], #[]=, #initialize, #inspect, #merge, #method_missing, #respond_to?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Tableless::InstanceMethods

Class Attribute Details

.attributesObject (readonly)

Returns the value of attribute attributes.



37
38
39
# File 'lib/tableless_model.rb', line 37

def attributes
  @attributes
end

Instance Attribute Details

#__owner_objectObject

Returns the value of attribute __owner_object.



27
28
29
# File 'lib/tableless_model.rb', line 27

def __owner_object
  @__owner_object
end

#__serialized_attributeObject

Returns the value of attribute __serialized_attribute.



27
28
29
# File 'lib/tableless_model.rb', line 27

def __serialized_attribute
  @__serialized_attribute
end