Class: Azeroth::Options Private
- Inherits:
-
Sinclair::Options
- Object
- Sinclair::Options
- Azeroth::Options
- Defined in:
- lib/azeroth/options.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Resource buiilding options
Constant Summary collapse
- DEFAULT_OPTIONS =
Default options
{ only: i[create destroy edit index new show update], except: [], id_key: :id, param_key: :id, decorator: true, before_save: nil, after_save: nil, build_with: nil, update_with: nil, paginated: false, per_page: 20 }.freeze
Instance Method Summary collapse
-
#actions ⇒ Array<Symbol>
private
Actions to be built.
-
#after_save ⇒ Symbol, Proc
private
Block or method name to be run after save.
-
#before_save ⇒ Symbol, Proc
private
Block or method name to be run before save.
-
#build_with ⇒ Symbol, Proc
private
Block or method name to be ran when building the resource.
-
#decorator ⇒ Decorator, ...
private
decorator class to be used.
-
#event_registry ⇒ Jace::Registry
private
Returns the event registry.
-
#except ⇒ Array<String,Symbol>
private
actions to be ignored.
-
#id_key ⇒ Symbol
private
key used to find a model.
-
#only ⇒ Array<String,Symbol>
private
filter of only actions to be built.
-
#paginated ⇒ TrueClass, FalseClass
(also: #paginated?)
private
Boolean indicating if pagination should or not be used.
-
#param_key ⇒ Symbol
private
parameter key used to find the model.
-
#update_with ⇒ Symbol, Proc
private
Block or method name to be ran when updating the resource.
Instance Method Details
#actions ⇒ Array<Symbol>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Actions to be built
36 37 38 |
# File 'lib/azeroth/options.rb', line 36 def actions [only].flatten.map(&:to_sym) - [except].flatten.map(&:to_sym) end |
#after_save ⇒ Symbol, Proc
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Block or method name to be run after save
The given method or block will be ran after committing changes in models to database
|
|
# File 'lib/azeroth/options.rb', line 107
|
#before_save ⇒ Symbol, Proc
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Block or method name to be run before save
The given method or block will be ran before committing changes in models to database
|
|
# File 'lib/azeroth/options.rb', line 96
|
#build_with ⇒ Symbol, Proc
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Block or method name to be ran when building the resource
|
|
# File 'lib/azeroth/options.rb', line 118
|
#decorator ⇒ Decorator, ...
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
decorator class to be used
when set as true/false, it either infer the class (model_class::Decorator) or do not use a decorator at all calling model.as_json
|
|
# File 'lib/azeroth/options.rb', line 84
|
#event_registry ⇒ Jace::Registry
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the event registry
Event registry is used to handle events within the request
45 46 47 |
# File 'lib/azeroth/options.rb', line 45 def event_registry @event_registry ||= build_event_registry end |
#except ⇒ Array<String,Symbol>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
actions to be ignored
|
|
# File 'lib/azeroth/options.rb', line 63
|
#id_key ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
key used to find a model. id by default
|
|
# File 'lib/azeroth/options.rb', line 70
|
#only ⇒ Array<String,Symbol>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
filter of only actions to be built
|
|
# File 'lib/azeroth/options.rb', line 56
|
#paginated ⇒ TrueClass, FalseClass Also known as: paginated?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Boolean indicating if pagination should or not be used
|
|
# File 'lib/azeroth/options.rb', line 132
|
#param_key ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
parameter key used to find the model
|
|
# File 'lib/azeroth/options.rb', line 77
|
#update_with ⇒ Symbol, Proc
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Block or method name to be ran when updating the resource
|
|
# File 'lib/azeroth/options.rb', line 125
|