Sha256: 961594e4fc4818428b8bb73ffd0ca13d82e2fac204d87458e321aff1294f12bc

Contents?: true

Size: 529 Bytes

Versions: 25

Compression:

Stored size: 529 Bytes

Contents

require_relative 'cacheable'
require_relative 'active_record_shim'

module WCC
  module Media
    class Base
      include WCC::Media::Cacheable
      include WCC::Media::ActiveRecordShim

      attr_reader :raw, :headers

      def initialize(raw, headers = {})
        @raw = raw
        @headers = headers
      end

      def id
        raw['id']&.to_s
      end

      def legacy_id
        raw['legacy_id']&.to_s
      end

      def _links
        OpenStruct.new(raw['_links']) if raw['_links']
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
wcc-media-client-0.4.15 lib/wcc/media/base.rb
wcc-media-client-0.4.14 lib/wcc/media/base.rb
wcc-media-client-0.4.13 lib/wcc/media/base.rb
wcc-media-client-0.4.12 lib/wcc/media/base.rb
wcc-media-client-0.4.11 lib/wcc/media/base.rb
wcc-media-client-0.4.10 lib/wcc/media/base.rb
wcc-media-client-0.4.9 lib/wcc/media/base.rb
wcc-media-client-0.4.8 lib/wcc/media/base.rb
wcc-media-client-0.4.7 lib/wcc/media/base.rb
wcc-media-client-0.4.6 lib/wcc/media/base.rb
wcc-media-client-0.4.5 lib/wcc/media/base.rb
wcc-media-client-0.4.4 lib/wcc/media/base.rb
wcc-media-client-0.4.3 lib/wcc/media/base.rb
wcc-media-client-0.4.2 lib/wcc/media/base.rb
wcc-media-client-0.4.1 lib/wcc/media/base.rb
wcc-media-client-0.4.0 lib/wcc/media/base.rb
wcc-media-client-0.3.8 lib/wcc/media/base.rb
wcc-media-client-0.3.7 lib/wcc/media/base.rb
wcc-media-client-0.3.6 lib/wcc/media/base.rb
wcc-media-client-0.3.5 lib/wcc/media/base.rb