Class: FmStore::Associations::HasMany

Inherits:
Proxy
  • Object
show all
Defined in:
lib/fm_store/associations/has_many.rb

Instance Attribute Summary collapse

Attributes inherited from Proxy

#options, #target

Instance Method Summary collapse

Methods inherited from Proxy

#method_missing

Constructor Details

#initialize(layout, options) ⇒ HasMany

Returns a new instance of HasMany.



9
10
11
12
13
14
15
# File 'lib/fm_store/associations/has_many.rb', line 9

def initialize(layout, options)
  @layout, @association_name = layout, options.name
  @klass, @reference_key, @options = options.klass, options.reference_key, options
  @format_with = options.format_with
  
  build_children
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FmStore::Associations::Proxy

Instance Attribute Details

#association_nameObject

Returns the value of attribute association_name.



6
7
8
# File 'lib/fm_store/associations/has_many.rb', line 6

def association_name
  @association_name
end

#klassObject

Returns the value of attribute klass.



6
7
8
# File 'lib/fm_store/associations/has_many.rb', line 6

def klass
  @klass
end