Sha256: 1b760a53981f632e3808bc454ee11342393cc2aadfab722e6306856483cf5498
Contents?: true
Size: 684 Bytes
Versions: 2
Compression:
Stored size: 684 Bytes
Contents
# frozen_string_literal: true require 'time' module Kentaa module Api module Resources class Resource < Base attr_accessor :id def initialize(config, options = {}) super(config, options) if options.key?(:data) @data = options.delete(:data) || {} @id = @data.fetch(:id) if @data.key?(:id) elsif options.key?(:id) @id = options.delete(:id) end 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 end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
kentaa-api-0.3.1 | lib/kentaa/api/resources/resource.rb |
kentaa-api-0.3.0 | lib/kentaa/api/resources/resource.rb |