lib/kentaa/api/resources/video.rb in kentaa-api-0.3.2 vs lib/kentaa/api/resources/video.rb in kentaa-api-0.4.0

- old
+ new

@@ -1,10 +1,30 @@ # frozen_string_literal: true +require 'time' + module Kentaa module Api module Resources - class Video < Resource + class Video + attr_reader :data + + def initialize(data) + @data = data + end + + def id + data[:id] + end + + def created_at + Time.parse(data[:created_at]) if data[:created_at] + end + + def updated_at + Time.parse(data[:updated_at]) if data[:updated_at] + end + def url data[:url] end end end