Sha256: ffa5308e72580c871c6e2010415118d4d98142d8cb8b7c18adbe8e3ea102f5d8

Contents?: true

Size: 430 Bytes

Versions: 9

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

require_relative 'base'
require_relative 'tag_group'

class WCC::Media::Tag < WCC::Media::Base
  active_record_shim do
    endpoint 'tags'
    filters %w[
      name_like
    ]
  end

  %w[
    name
    code
  ].each do |att|
    define_method att do
      raw[att]
    end
  end

  def tag_group
    return unless (key = raw.dig('tag_group', 'key'))

    WCC::Media::TagGroup[key.to_sym]
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wcc-media-client-0.7.5 lib/wcc/media/tag.rb
wcc-media-client-0.7.4 lib/wcc/media/tag.rb
wcc-media-client-0.7.3 lib/wcc/media/tag.rb
wcc-media-client-0.7.2 lib/wcc/media/tag.rb
wcc-media-client-0.7.1 lib/wcc/media/tag.rb
wcc-media-client-0.7.0 lib/wcc/media/tag.rb
wcc-media-client-0.6.1 lib/wcc/media/tag.rb
wcc-media-client-0.6.0 lib/wcc/media/tag.rb
wcc-media-client-0.5.0 lib/wcc/media/tag.rb