Module: RailsAdmin::Config::Configurable
- Included in:
- Actions::Base, Fields::Base, Fields::Group, Fields::Types::MultipleFileUpload::AbstractAttachment, Model, Sections::Base, Extensions::CanCanCan::AuthorizationAdapter, Extensions::PaperTrail::AuditingAdapter
- 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
rubocop:disable Naming/PredicateName.
- #register_deprecated_instance_option(option_name, replacement_option_name = nil, &custom_error) ⇒ Object
-
#register_instance_option(option_name, &default) ⇒ Object
Register an instance option for this object only.
Class Method Details
.included(base) ⇒ Object
8 9 10 |
# File 'lib/rails_admin/config/configurable.rb', line 8 def self.included(base) base.send :extend, ClassMethods end |
Instance Method Details
#has_option?(name) ⇒ Boolean
rubocop:disable Naming/PredicateName
12 13 14 15 |
# File 'lib/rails_admin/config/configurable.rb', line 12 def has_option?(name) # rubocop:disable Naming/PredicateName = self.class.instance_variable_get('@config_options') &.key?(name) end |
#register_deprecated_instance_option(option_name, replacement_option_name = nil, &custom_error) ⇒ Object
23 24 25 26 |
# File 'lib/rails_admin/config/configurable.rb', line 23 def register_deprecated_instance_option(option_name, replacement_option_name = nil, &custom_error) scope = class << self; self; end self.class.register_deprecated_instance_option(option_name, replacement_option_name, scope, &custom_error) end |
#register_instance_option(option_name, &default) ⇒ Object
Register an instance option for this object only
18 19 20 21 |
# File 'lib/rails_admin/config/configurable.rb', line 18 def register_instance_option(option_name, &default) scope = class << self; self; end self.class.register_instance_option(option_name, scope, &default) end |