Module: RailsAdmin::Config::Configurable
- Included in:
- Actions::Base, Fields::Base, Fields::Group, Model, Sections::Base
- Defined in:
- lib/rails_admin/config/configurable.rb
Overview
A module for all configurables.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #has_option?(name) ⇒ Boolean
- #register_deprecated_instance_option(option_name, replacement_option_name) ⇒ Object
-
#register_instance_option(option_name, &default) ⇒ Object
Register an instance option for this object only.
Class Method Details
.included(base) ⇒ Object
6 7 8 |
# File 'lib/rails_admin/config/configurable.rb', line 6 def self.included(base) base.send :extend, ClassMethods end |
Instance Method Details
#has_option?(name) ⇒ Boolean
10 11 12 13 |
# File 'lib/rails_admin/config/configurable.rb', line 10 def has_option?(name) = self.class.instance_variable_get("@config_options") && .has_key?(name) end |
#register_deprecated_instance_option(option_name, replacement_option_name) ⇒ Object
21 22 23 24 |
# File 'lib/rails_admin/config/configurable.rb', line 21 def register_deprecated_instance_option(option_name, replacement_option_name) scope = class << self; self; end; self.class.register_deprecated_instance_option(option_name, replacement_option_name, scope) end |
#register_instance_option(option_name, &default) ⇒ Object
Register an instance option for this object only
16 17 18 19 |
# File 'lib/rails_admin/config/configurable.rb', line 16 def register_instance_option(option_name, &default) scope = class << self; self; end; self.class.register_instance_option(option_name, scope, &default) end |