Class: ActsAsTable::Configuration
- Inherits:
-
Object
- Object
- ActsAsTable::Configuration
- Includes:
- Singleton
- Defined in:
- lib/acts_as_table.rb
Overview
ActsAsTable configuration object.
Instance Attribute Summary collapse
-
#adapter ⇒ ActsAsTable::Adapter
Returns the ActsAsTable adapter object (default:
ActsAsTable::Adapter.new
). -
#belongs_tos_table ⇒ Symbol
Returns the table name for the BelongsTo class (default:
:belongs_tos
). -
#column_models_table ⇒ Symbol
Returns the table name for the ColumnModel class (default:
:column_models
). -
#foreign_key_maps_table ⇒ Symbol
Returns the table name for the ForeignKeyMap class (default:
:foreign_key_maps
). -
#foreign_keys_table ⇒ Symbol
Returns the table name for the ForeignKey class (default:
:foreign_key
). -
#formats ⇒ Array<Symbol>
Returns the non-inherited constant names for available ActsAsTable serialization format modules (default:
[]
). -
#has_manies_table ⇒ Symbol
Returns the table name for the HasMany class (default:
:has_manies
). -
#has_many_targets_table ⇒ Symbol
Returns the table name for the HasManyTarget class (default:
:has_many_targets
). -
#lenses_table ⇒ Symbol
Returns the table name for the Lense class (default:
:lenses
). -
#primary_keys_table ⇒ Symbol
Returns the table name for the PrimaryKey class (default:
:primary_keys
). -
#record_errors_table ⇒ Symbol
Returns the table name for the RecordError class (default:
:record_errors
). -
#record_models_table ⇒ Symbol
Returns the table name for the RecordModel class (default:
:record_models
). -
#records_table ⇒ Symbol
Returns the table name for the Record class (default:
:records
). -
#row_models_table ⇒ Symbol
Returns the table name for the RowModel class (default:
:row_model
). -
#tables_table ⇒ Symbol
Returns the table name for the Table class (default:
:table
). -
#values_table ⇒ Symbol
Returns the table name for the Value class (default:
:value
).
Instance Method Summary collapse
-
#initialize ⇒ ActsAsTable::Configuration
constructor
Returns a new ActsAsTable configuration object.
Constructor Details
#initialize ⇒ ActsAsTable::Configuration
Returns a new ActsAsTable configuration object.
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/acts_as_table.rb', line 203 def initialize @adapter = ActsAsTable::Adapter.new @formats = [] @belongs_tos_table = :belongs_tos @column_models_table = :column_models @foreign_key_maps_table = :foreign_key_maps @foreign_keys_table = :foreign_keys @has_manies_table = :has_manies @has_many_targets_table = :has_many_targets @lenses_table = :lenses @primary_keys_table = :primary_keys @record_errors_table = :record_errors @record_models_table = :record_models @records_table = :records @row_models_table = :row_models @tables_table = :tables @values_table = :values end |
Instance Attribute Details
#adapter ⇒ ActsAsTable::Adapter
Returns the ActsAsTable adapter object (default: ActsAsTable::Adapter.new
).
132 133 134 |
# File 'lib/acts_as_table.rb', line 132 def adapter @adapter end |
#belongs_tos_table ⇒ Symbol
Returns the table name for the BelongsTo class (default: :belongs_tos
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#column_models_table ⇒ Symbol
Returns the table name for the ActsAsTable::ColumnModel class (default: :column_models
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#foreign_key_maps_table ⇒ Symbol
Returns the table name for the ForeignKeyMap class (default: :foreign_key_maps
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#foreign_keys_table ⇒ Symbol
Returns the table name for the ForeignKey class (default: :foreign_key
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#formats ⇒ Array<Symbol>
Returns the non-inherited constant names for available ActsAsTable serialization format modules (default: []
).
138 139 140 |
# File 'lib/acts_as_table.rb', line 138 def formats @formats end |
#has_manies_table ⇒ Symbol
Returns the table name for the HasMany class (default: :has_manies
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#has_many_targets_table ⇒ Symbol
Returns the table name for the HasManyTarget class (default: :has_many_targets
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#lenses_table ⇒ Symbol
Returns the table name for the Lense class (default: :lenses
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#primary_keys_table ⇒ Symbol
Returns the table name for the PrimaryKey class (default: :primary_keys
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#record_errors_table ⇒ Symbol
Returns the table name for the RecordError class (default: :record_errors
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#record_models_table ⇒ Symbol
Returns the table name for the RecordModel class (default: :record_models
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#records_table ⇒ Symbol
Returns the table name for the Record class (default: :records
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#row_models_table ⇒ Symbol
Returns the table name for the RowModel class (default: :row_model
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#tables_table ⇒ Symbol
Returns the table name for the Table class (default: :table
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |
#values_table ⇒ Symbol
Returns the table name for the Value class (default: :value
).
196 197 198 |
# File 'lib/acts_as_table.rb', line 196 %w(BelongsTo ColumnModel ForeignKey ForeignKeyMap HasMany HasManyTarget Lense PrimaryKey Record RecordError RecordModel RowModel Table Value).each do |class_name| attr_accessor :"#{class_name.pluralize.underscore}_table" end |