Class: Lafcadio::DomainObject::SubclassRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/lafcadio/domain.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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_hashObject

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

#fieldsObject

Returns the value of attribute fields.



830
831
832
# File 'lib/lafcadio/domain.rb', line 830

def fields
  @fields
end

#sql_primary_keyObject

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_fieldsObject



838
839
840
# File 'lib/lafcadio/domain.rb', line 838

def maybe_init_fields
	self.fields = [ pk_field ] if self.fields.nil?
end

#pk_fieldObject



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