Class: ActiveRecordDataLoader::Dsl::BelongsToAssociation

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record_data_loader/dsl/belongs_to_association.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model_class, name, query = nil) ⇒ BelongsToAssociation

Returns a new instance of BelongsToAssociation.



8
9
10
11
12
# File 'lib/active_record_data_loader/dsl/belongs_to_association.rb', line 8

def initialize(model_class, name, query = nil)
  @model_class = model_class
  @name = name
  @query = query
end

Instance Attribute Details

#model_classObject (readonly)

Returns the value of attribute model_class.



6
7
8
# File 'lib/active_record_data_loader/dsl/belongs_to_association.rb', line 6

def model_class
  @model_class
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/active_record_data_loader/dsl/belongs_to_association.rb', line 6

def name
  @name
end

#queryObject (readonly)

Returns the value of attribute query.



6
7
8
# File 'lib/active_record_data_loader/dsl/belongs_to_association.rb', line 6

def query
  @query
end