Method: CloudKit::OpenIDStore#store_association

Defined in:
lib/cloudkit/openid_store.rb

#store_association(server_url, association) ⇒ Object

:nodoc:



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/cloudkit/openid_store.rb', line 53

def store_association(server_url, association) #:nodoc:
  remove_association(server_url, association.handle)
  json = JSON.generate(
    :server_url => server_url,
    :handle     => Base64.encode64(association.handle),
    :secret     => Base64.encode64(association.secret),
    :issued     => association.issued.to_i,
    :lifetime   => association.lifetime,
    :assoc_type => association.assoc_type)
  result = @@store.post(CloudKit::URI.new('/cloudkit_openid_associations'), :json => json)
  return (result.status == 201)
end