Class: Bartleby::AssocOptions
- Inherits:
-
Object
- Object
- Bartleby::AssocOptions
- Defined in:
- lib/bartleby/associatable.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#foreign_key ⇒ Object
Returns the value of attribute foreign_key.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
Instance Method Summary collapse
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
6 7 8 |
# File 'lib/bartleby/associatable.rb', line 6 def class_name @class_name end |
#foreign_key ⇒ Object
Returns the value of attribute foreign_key.
6 7 8 |
# File 'lib/bartleby/associatable.rb', line 6 def foreign_key @foreign_key end |
#primary_key ⇒ Object
Returns the value of attribute primary_key.
6 7 8 |
# File 'lib/bartleby/associatable.rb', line 6 def primary_key @primary_key end |
Instance Method Details
#model_class ⇒ Object
12 13 14 |
# File 'lib/bartleby/associatable.rb', line 12 def model_class class_name.constantize end |
#table_name ⇒ Object
16 17 18 |
# File 'lib/bartleby/associatable.rb', line 16 def table_name class_name.underscore + 's' end |