Class: FmStore::Associations::BelongsTo

Inherits:
Proxy
  • Object
show all
Defined in:
lib/fm_store/associations/belongs_to.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) ⇒ BelongsTo

Returns a new instance of BelongsTo.



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

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_parent
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/belongs_to.rb', line 6

def association_name
  @association_name
end

#klassObject

Returns the value of attribute klass.



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

def klass
  @klass
end