Class: RbsActiverecord::Generator::Associations
- Inherits:
-
Object
- Object
- RbsActiverecord::Generator::Associations
- Includes:
- Utils
- Defined in:
- lib/rbs_activerecord/generator/associations.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
: RbsActiverecord::Model.
Instance Method Summary collapse
-
#generate ⇒ Object
: String.
-
#initialize(model) ⇒ Associations
constructor
A new instance of Associations.
Methods included from Utils
#format, #primary_key_type_for, #sql_type_to_class
Constructor Details
#initialize(model) ⇒ Associations
Returns a new instance of Associations.
11 12 13 |
# File 'lib/rbs_activerecord/generator/associations.rb', line 11 def initialize(model) #: void @model = model end |
Instance Attribute Details
#model ⇒ Object (readonly)
: RbsActiverecord::Model
8 9 10 |
# File 'lib/rbs_activerecord/generator/associations.rb', line 8 def model @model end |
Instance Method Details
#generate ⇒ Object
: String
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rbs_activerecord/generator/associations.rb', line 15 def generate #: String <<~RBS.strip module GeneratedAssociationMethods #{has_many} #{has_one} #{belongs_to} #{has_and_belongs_to_many} end RBS end |