Class: ActiveScaffold::Config::Base
- Inherits:
-
Object
- Object
- ActiveScaffold::Config::Base
- Extended by:
- ActiveScaffold::Configurable
- Includes:
- ActiveScaffold::Configurable
- Defined in:
- lib/active_scaffold/config/base.rb
Defined Under Namespace
Classes: UserSettings
Instance Attribute Summary (collapse)
-
- (Object) action_group
action_group this action should belong to.
-
- (Object) user
the user property gets set to the instantiation of the local UserSettings class during the automatic instantiation of this class.
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Object) crud_type
delegate.
- - (Object) formats
- - (Object) formats=(val)
-
- (Base) initialize(core_config)
constructor
A new instance of Base.
- - (Object) label(model = nil)
Methods included from ActiveScaffold::Configurable
Constructor Details
- (Base) initialize(core_config)
A new instance of Base
6 7 8 |
# File 'lib/active_scaffold/config/base.rb', line 6 def initialize(core_config) @core = core_config end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable
Instance Attribute Details
- (Object) action_group
action_group this action should belong to
41 42 43 |
# File 'lib/active_scaffold/config/base.rb', line 41 def action_group @action_group end |
- (Object) user
the user property gets set to the instantiation of the local UserSettings class during the automatic instantiation of this class.
34 35 36 |
# File 'lib/active_scaffold/config/base.rb', line 34 def user @user end |
Class Method Details
+ (Object) inherited(subclass)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/active_scaffold/config/base.rb', line 10 def self.inherited(subclass) class << subclass # the crud type of the action. possible values are :create, :read, :update, :delete, and nil. # this is not a setting for the developer. it's self-description for the actions. def crud_type; @crud_type; end protected def crud_type=(val) raise ArgumentError, "unknown CRUD type #{val}" unless [:create, :read, :update, :delete].include?(val.to_sym) @crud_type = val.to_sym end end end |
Instance Method Details
- (Object) crud_type
delegate
26 |
# File 'lib/active_scaffold/config/base.rb', line 26 def crud_type; self.class.crud_type end |
- (Object) formats
54 55 56 |
# File 'lib/active_scaffold/config/base.rb', line 54 def formats @formats ||= [] end |
- (Object) formats=(val)
58 59 60 |
# File 'lib/active_scaffold/config/base.rb', line 58 def formats=(val) @formats=val end |
- (Object) label(model = nil)
28 29 30 31 |
# File 'lib/active_scaffold/config/base.rb', line 28 def label(model = nil) model ||= @core.label(:count => 1) @label.nil? ? model : as_(@label, :model => model) end |