Sha256: b905e08a0ee4351d9878575b9c8c8e1b4545a51692fa9d83def90a1cd99834a6

Contents?: true

Size: 322 Bytes

Versions: 6

Compression:

Stored size: 322 Bytes

Contents

# frozen_string_literal: true

module ActionKitRest
  class Tag < Base
    def base_path
      'tag'
    end

    def find(name)
      response = list(name: name)
      response.obj.first
    end

    def find_or_create(name)
      tag = find(name)
      tag = create(name: name) if tag.blank?
      tag
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
action_kit_rest-0.4.10 lib/action_kit_rest/tag.rb
action_kit_rest-0.4.9 lib/action_kit_rest/tag.rb
action_kit_rest-0.4.8 lib/action_kit_rest/tag.rb
action_kit_rest-0.4.7 lib/action_kit_rest/tag.rb
action_kit_rest-0.4.6 lib/action_kit_rest/tag.rb
action_kit_rest-0.4.5 lib/action_kit_rest/tag.rb