Sha256: afac03f2036409d4a3ea841ab15644a914a86ed7c53b76346f5d1927d07ad9cf

Contents?: true

Size: 723 Bytes

Versions: 5

Compression:

Stored size: 723 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'awesome_print'
require 'collectionspace/client'

# CREATE CLIENT WITH DEFAULT (DEMO) CONFIGURATION -- BE NICE!!!
client = CollectionSpace::Client.new
client.config.throttle = 1

# GET REQUEST FOR CONDITIONCHECK RECORDS AND PRINT THE PARSED RESPONSE AND XML
response = client.get('conditionchecks')
if response.status_code == 200
  ap response.parsed
  ap response.xml
end

# GET ALL ACQUISITIONS AND PRINT TO CONSOLE
acquisitions = client.all('acquisitions')
ap acquisitions

# GET ALL INTAKE RECORDS AND PROCESS PER PAGE (INSTEAD OF WAITING FOR ALL)
client.all('intakes') do |item|
  uri    = item["uri"]
  intake = client.get uri
  ap intake.parsed
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
collectionspace-client-0.1.4 examples/demo.rb
collectionspace-client-0.1.3 examples/demo.rb
collectionspace-client-0.1.2 examples/demo.rb
collectionspace-client-0.1.1 examples/demo.rb
collectionspace-client-0.1.0 examples/demo.rb