Class: ArchivesSpace::Client
- Inherits:
-
Object
- Object
- ArchivesSpace::Client
show all
- Includes:
- Helpers
- Defined in:
- lib/archivesspace/client/client.rb,
lib/archivesspace/client/version.rb
Constant Summary
collapse
- VERSION =
"0.1.1"
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Helpers
#accessions, #all, #backend_version, #batch_import, #digital_object_to_xml, #digital_objects, #group_user_assignment, #groups, #login, #password_reset, #repositories, #repositories_with_agent, #resource_to_xml, #resources, #search, #users
Constructor Details
#initialize(config = Configuration.new) ⇒ Client
8
9
10
11
12
|
# File 'lib/archivesspace/client/client.rb', line 8
def initialize(config = Configuration.new)
raise "Invalid configuration object" unless config.kind_of? ArchivesSpace::Configuration
@config = config
@token = nil
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6
7
8
|
# File 'lib/archivesspace/client/client.rb', line 6
def config
@config
end
|
#token ⇒ Object
Returns the value of attribute token.
5
6
7
|
# File 'lib/archivesspace/client/client.rb', line 5
def token
@token
end
|
Instance Method Details
#delete(path) ⇒ Object
26
27
28
|
# File 'lib/archivesspace/client/client.rb', line 26
def delete(path)
request 'DELETE', path
end
|
#get(path, options = {}) ⇒ Object
14
15
16
|
# File 'lib/archivesspace/client/client.rb', line 14
def get(path, options = {})
request 'GET', path, options
end
|
#post(path, payload, params = {}) ⇒ Object
18
19
20
|
# File 'lib/archivesspace/client/client.rb', line 18
def post(path, payload, params = {})
request 'POST', path, { body: payload.to_json, query: params }
end
|
#put(path, payload, params = {}) ⇒ Object
22
23
24
|
# File 'lib/archivesspace/client/client.rb', line 22
def put(path, payload, params = {})
request 'PUT', path, { body: payload.to_json, query: params }
end
|