Files
old-vendor-scheduler-service/app/services/schedule_pipeline/models/schedule_item.rb
2022-03-23 05:44:42 +01:00

31 lines
650 B
Ruby

# frozen_string_literal: true
module SchedulePipeline
module Models
class ScheduleItem
attr_reader :duration, :content_key, :pop_data
def initialize(duration, content_key, pop_data)
@duration = duration
@content_key = content_key
@pop_data = pop_data
end
def to_hash
{
duration: @duration,
content_key: @content_key,
pop_data: @pop_data
}.with_indifferent_access
end
def self.from_hash(input)
self.new(
input[:duration],
input[:content_key],
input[:pop_data]
)
end
end
end
end