Class: OperatorRecordable::Configuration::Model

Inherits:
Object
  • Object
show all
Defined in:
lib/operator_recordable/configuration.rb

Constant Summary collapse

VALID_ACTIONS =
%i[create update destroy discard].freeze

Instance Method Summary collapse

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

Returns:

  • (Boolean)


65
66
67
# File 'lib/operator_recordable/configuration.rb', line 65

def record_creator?
  actions.include? :create
end

#record_deleter?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/operator_recordable/configuration.rb', line 73

def record_deleter?
  actions.include? :destroy
end

#record_discarder?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/operator_recordable/configuration.rb', line 77

def record_discarder?
  actions.include? :discard
end

#record_updater?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/operator_recordable/configuration.rb', line 69

def record_updater?
  actions.include? :update
end