Sha256: 6ef5d2ed7edfdd040f1b3258c92ca5a736c56d62cb3d137c69977e5ca3da8a22

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

module ActionNetworkRest
  class Taggings < Base
    attr_accessor :tag_id

    def base_path
      "tags/#{url_escape(tag_id)}/taggings/"
    end

    def create(tagging_data, person_id:)
      post_body = tagging_data
      person_url = action_network_url("/people/#{url_escape(person_id)}")
      post_body['_links'] = {'osdi:person' => {href: person_url}}

      response = client.post_request base_path, post_body
      object_from_response(response)
    end

    def delete(id)
      response = client.delete_request "#{base_path}#{url_escape(id)}"
      object_from_response(response)
    end

    private

    def osdi_key
      'osdi:taggings'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
action_network_rest-0.6.0 lib/action_network_rest/taggings.rb
action_network_rest-0.5.0 lib/action_network_rest/taggings.rb