Class: OperatorRecordable::Configuration::Model
- Inherits:
-
Object
- Object
- OperatorRecordable::Configuration::Model
- Defined in:
- lib/operator_recordable/configuration.rb
Constant Summary collapse
- VALID_ACTIONS =
%i[create update destroy discard].freeze
Instance Method Summary collapse
-
#initialize(actions) ⇒ Model
constructor
A new instance of Model.
- #record_creator? ⇒ Boolean
- #record_deleter? ⇒ Boolean
- #record_discarder? ⇒ Boolean
- #record_updater? ⇒ Boolean
Constructor Details
#initialize(actions) ⇒ Model
Returns a new instance of Model.
60 61 62 63 |
# File 'lib/operator_recordable/configuration.rb', line 60 def initialize(actions) @actions = actions assert_actions end |
Instance Method Details
#record_creator? ⇒ Boolean
65 66 67 |
# File 'lib/operator_recordable/configuration.rb', line 65 def record_creator? actions.include? :create end |
#record_deleter? ⇒ Boolean
73 74 75 |
# File 'lib/operator_recordable/configuration.rb', line 73 def record_deleter? actions.include? :destroy end |
#record_discarder? ⇒ Boolean
77 78 79 |
# File 'lib/operator_recordable/configuration.rb', line 77 def record_discarder? actions.include? :discard end |
#record_updater? ⇒ Boolean
69 70 71 |
# File 'lib/operator_recordable/configuration.rb', line 69 def record_updater? actions.include? :update end |