Class: FmStore::Associations::Options
- Inherits:
-
Object
- Object
- FmStore::Associations::Options
- Defined in:
- lib/fm_store/associations/options.rb
Instance Method Summary collapse
- #class_name ⇒ Object
- #format_with ⇒ Object
-
#initialize(attributes = {}) ⇒ Options
constructor
A new instance of Options.
- #klass ⇒ Object
- #name ⇒ Object
- #reference_key ⇒ Object
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_name ⇒ Object
17 18 19 |
# File 'lib/fm_store/associations/options.rb', line 17 def class_name @attributes[:class_name] || name.to_s.classify end |
#format_with ⇒ Object
25 26 27 |
# File 'lib/fm_store/associations/options.rb', line 25 def format_with @attributes[:format_with] end |
#klass ⇒ Object
13 14 15 |
# File 'lib/fm_store/associations/options.rb', line 13 def klass class_name.constantize end |
#name ⇒ Object
21 22 23 |
# File 'lib/fm_store/associations/options.rb', line 21 def name @attributes[:name].to_s end |
#reference_key ⇒ Object
9 10 11 |
# File 'lib/fm_store/associations/options.rb', line 9 def reference_key @attributes[:reference_key] end |