Module: SettingCrazy::ClassMethods
- Defined in:
- lib/settingcrazy/class_methods.rb
Instance Method Summary collapse
- #_inheritor ⇒ Object
- #_setting_namespaces ⇒ Object
- #setting_namespace(name, options = {}) ⇒ Object
- #setting_template(record) ⇒ Object
- #settings_inherit_via(reflection, options = {}) ⇒ Object
- #use_setting_template(template = nil, &block) ⇒ Object
Instance Method Details
#_inheritor ⇒ Object
16 17 18 |
# File 'lib/settingcrazy/class_methods.rb', line 16 def _inheritor @inheritor end |
#_setting_namespaces ⇒ Object
20 21 22 |
# File 'lib/settingcrazy/class_methods.rb', line 20 def _setting_namespaces @setting_namespaces end |
#setting_namespace(name, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/settingcrazy/class_methods.rb', line 11 def setting_namespace(name, = {}) @setting_namespaces ||= {} @setting_namespaces[name.to_sym] = Namespace.new(name, ) end |
#setting_template(record) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/settingcrazy/class_methods.rb', line 24 def setting_template(record) case @template when String then @template.constantize when Class then @template when Proc then @template.call(record) end end |
#settings_inherit_via(reflection, options = {}) ⇒ Object
7 8 9 |
# File 'lib/settingcrazy/class_methods.rb', line 7 def settings_inherit_via(reflection, = {}) @inheritor = Inheritor.new(reflection, ) end |
#use_setting_template(template = nil, &block) ⇒ Object
3 4 5 |
# File 'lib/settingcrazy/class_methods.rb', line 3 def use_setting_template(template = nil, &block) @template = template || block end |