Method: OpenC3::ReactionModel#initialize
- Defined in:
- lib/openc3/models/reaction_model.rb
#initialize(name:, scope:, snooze:, actions:, triggers:, trigger_level:, enabled: true, snoozed_until: nil, username: nil, shard: 0, updated_at: nil) ⇒ ReactionModel
Returns a new instance of ReactionModel.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/openc3/models/reaction_model.rb', line 87 def initialize( name:, scope:, snooze:, actions:, triggers:, trigger_level:, enabled: true, snoozed_until: nil, username: nil, shard: 0, updated_at: nil ) super("#{scope}#{PRIMARY_KEY}", name: name, scope: scope) @microservice_name = "#{scope}__OPENC3__REACTION" @enabled = enabled @snoozed_until = snoozed_until @trigger_level = validate_level(trigger_level) @snooze = validate_snooze(snooze) @actions = validate_actions(actions) @triggers = validate_triggers(triggers) @username = username @shard = shard.to_i # to_i to handle nil @updated_at = updated_at end |