Sha256: be3a84d3d27106909f0a5c38b8d1de9dece8a7d6fee0c91f3a1dc6068bef5176

Contents?: true

Size: 460 Bytes

Versions: 6

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

module ActionKitRest
  class AllowedUserField < Base
    def base_path
      'alloweduserfield'
    end

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

    private

    # We must override this, because the paths for allowed user fields use the name,
    # not a numerical ID.
    def extract_id_from_response(resp)
      resp.response.headers['location'].split('/').last
    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/allowed_user_field.rb
action_kit_rest-0.4.9 lib/action_kit_rest/allowed_user_field.rb
action_kit_rest-0.4.8 lib/action_kit_rest/allowed_user_field.rb
action_kit_rest-0.4.7 lib/action_kit_rest/allowed_user_field.rb
action_kit_rest-0.4.6 lib/action_kit_rest/allowed_user_field.rb
action_kit_rest-0.4.5 lib/action_kit_rest/allowed_user_field.rb