Class: ActiveScaffold::Config::Core::UserSettings

Inherits:
Base::UserSettings show all
Includes:
ActiveScaffold::Configurable
Defined in:
lib/active_scaffold/config/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ActiveScaffold::Configurable

#configure

Methods inherited from Base::UserSettings

#[], #[]=, #core, #initialize, #key?, #proxy_to_conf?, session_attr, #user, user_attr

Constructor Details

This class inherits a constructor from ActiveScaffold::Config::Base::UserSettings

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



316
317
318
319
# File 'lib/active_scaffold/config/core.rb', line 316

def method_missing(name, *args)
  value = @conf.actions.include?(name) ? @conf.send(name) : super
  value.is_a?(Base) ? (value) : value
end

Instance Attribute Details

#label(options = {}) ⇒ Object



312
313
314
# File 'lib/active_scaffold/config/core.rb', line 312

def label(options = {})
  @label ? as_(@label, options) : @conf.label(options)
end

Instance Method Details



336
337
338
# File 'lib/active_scaffold/config/core.rb', line 336

def action_links
  @conf.action_links
end

#action_user_settings(action_config) ⇒ Object



325
326
327
328
329
330
# File 'lib/active_scaffold/config/core.rb', line 325

def (action_config)
  if action_config.user.nil? && action_config.respond_to?(:new_user_settings)
    action_config. @storage, @params
  end
  action_config.user || action_config
end

#actionsObject



344
345
346
# File 'lib/active_scaffold/config/core.rb', line 344

def actions
  @conf.actions # for performance, called many times, so we avoid method_missing
end

#columnsObject



332
333
334
# File 'lib/active_scaffold/config/core.rb', line 332

def columns
  @columns ||= UserColumns.new(@conf.columns)
end

#modelObject



340
341
342
# File 'lib/active_scaffold/config/core.rb', line 340

def model
  @conf.model # for performance, called many times, so we avoid method_missing
end

#respond_to_missing?(name, include_all = false) ⇒ Boolean

Returns:

  • (Boolean)


321
322
323
# File 'lib/active_scaffold/config/core.rb', line 321

def respond_to_missing?(name, include_all = false)
  super # avoid rubocop warning
end