Class: Coarnotify::Client::NotifyResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/coarnotify/client.rb

Overview

An object representing the response from a COAR Notify inbox.

This contains the action that was carried out on the server:

  • CREATED - a new resource was created

  • ACCEPTED - the request was accepted, but the resource was not yet created

In the event that the resource is created, then there will also be a location URL which will give you access to the resource

Constant Summary collapse

CREATED =
"created"
ACCEPTED =
"accepted"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action, location = nil) ⇒ NotifyResponse

Construct a new NotifyResponse object with the action (created or accepted) and the location URL (optional)

Parameters:

  • action (String)

    The action which the server said it took

  • location (String, nil) (defaults to: nil)

    The HTTP URI for the resource that was created (if present)



31
32
33
34
# File 'lib/coarnotify/client.rb', line 31

def initialize(action, location = nil)
  @action = action
  @location = location
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



25
26
27
# File 'lib/coarnotify/client.rb', line 25

def action
  @action
end

#locationObject (readonly)

Returns the value of attribute location.



25
26
27
# File 'lib/coarnotify/client.rb', line 25

def location
  @location
end