Method: OpenC3::TimelineModel#initialize

Defined in:
lib/openc3/models/timeline_model.rb

#initialize(name:, scope:, updated_at: nil, color: nil, shard: 0, execute: true) ⇒ TimelineModel

Returns a new instance of TimelineModel.



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/openc3/models/timeline_model.rb', line 80

def initialize(name:, scope:, updated_at: nil, color: nil, shard: 0, execute: true)
  if name.nil? || scope.nil?
    raise TimelineInputError.new "name or scope must not be nil"
  end

  super(PRIMARY_KEY, name: "#{scope}#{KEY}#{name}", scope: scope)
  @updated_at = updated_at
  @timeline_name = name
  @shard = shard.to_i # to_i to handle nil
  self.color = color
  self.execute = execute
end