Class: Lafcadio::DomainObject::SubclassRecord
- Inherits:
-
Object
- Object
- Lafcadio::DomainObject::SubclassRecord
- Defined in:
- lib/lafcadio/domain.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#default_field_setup_hash ⇒ Object
Returns the value of attribute default_field_setup_hash.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#sql_primary_key ⇒ Object
Returns the value of attribute sql_primary_key.
Instance Method Summary collapse
-
#initialize(subclass) ⇒ SubclassRecord
constructor
A new instance of SubclassRecord.
- #maybe_init_fields ⇒ Object
- #pk_field ⇒ Object
Constructor Details
#initialize(subclass) ⇒ SubclassRecord
Returns a new instance of SubclassRecord.
832 833 834 835 836 |
# File 'lib/lafcadio/domain.rb', line 832 def initialize( subclass ) @subclass = subclass @default_field_setup_hash = Hash.new( {} ) @sql_primary_key = 'pk_id' end |
Instance Attribute Details
#default_field_setup_hash ⇒ Object
Returns the value of attribute default_field_setup_hash.
830 831 832 |
# File 'lib/lafcadio/domain.rb', line 830 def default_field_setup_hash @default_field_setup_hash end |
#fields ⇒ Object
Returns the value of attribute fields.
830 831 832 |
# File 'lib/lafcadio/domain.rb', line 830 def fields @fields end |
#sql_primary_key ⇒ Object
Returns the value of attribute sql_primary_key.
830 831 832 |
# File 'lib/lafcadio/domain.rb', line 830 def sql_primary_key @sql_primary_key end |
Instance Method Details
#maybe_init_fields ⇒ Object
838 839 840 |
# File 'lib/lafcadio/domain.rb', line 838 def maybe_init_fields self.fields = [ pk_field ] if self.fields.nil? end |
#pk_field ⇒ Object
842 843 844 845 846 847 848 |
# File 'lib/lafcadio/domain.rb', line 842 def pk_field if @pk_field.nil? @pk_field = PrimaryKeyField.new @subclass @pk_field.db_field_name = sql_primary_key end @pk_field end |