class ContentMirrorDto
  attr_accessor :id
  attr_accessor :source
  attr_accessor :ori_content_id
  attr_accessor :title
  attr_accessor :viwed_in_ft
  attr_accessor :liked_in_ft
  attr_accessor :link
  attr_accessor :vid_emded_obj
  attr_accessor :media_type
  attr_accessor :html
  attr_accessor :thumbnail_url
  attr_accessor :md5
  attr_accessor :like
  attr_accessor :dislike
  attr_accessor :duration
  attr_accessor :view_count
  attr_accessor :grades
  attr_accessor :diff
  attr_accessor :premium
  attr_accessor :manual
  attr_accessor :realtime
  attr_accessor :liked_user_ids
  attr_accessor :questions
  attr_accessor :cache_key

  def initialize(h)
    begin
      h.each { |k, v| public_send("#{k}=", v) if respond_to?("#{k}=") }
      @questions = @questions.map { |q| QuestionDto.new(q) } unless @questions.nil?
    rescue NoMethodError
    end
  end
end
