Class: FmStore::Associations::Options

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Options

Returns a new instance of Options.



5
6
7
# File 'lib/fm_store/associations/options.rb', line 5

def initialize(attributes = {})
  @attributes = attributes
end

Instance Method Details

#class_nameObject



17
18
19
# File 'lib/fm_store/associations/options.rb', line 17

def class_name
  @attributes[:class_name] || name.to_s.classify
end

#format_withObject



25
26
27
# File 'lib/fm_store/associations/options.rb', line 25

def format_with
  @attributes[:format_with]
end

#klassObject



13
14
15
# File 'lib/fm_store/associations/options.rb', line 13

def klass
  class_name.constantize
end

#nameObject



21
22
23
# File 'lib/fm_store/associations/options.rb', line 21

def name
  @attributes[:name].to_s
end

#reference_keyObject



9
10
11
# File 'lib/fm_store/associations/options.rb', line 9

def reference_key
  @attributes[:reference_key]
end