Class: Hyrax::Arkivo::CreateSubscriptionJob
- Inherits:
-
Hyrax::ApplicationJob
- Object
- ApplicationJob
- Hyrax::ApplicationJob
- Hyrax::Arkivo::CreateSubscriptionJob
- Defined in:
- lib/hyrax/arkivo/create_subscription_job.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
8 9 10 |
# File 'lib/hyrax/arkivo/create_subscription_job.rb', line 8 def user @user end |
Instance Method Details
#perform(user_key) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/hyrax/arkivo/create_subscription_job.rb', line 10 def perform(user_key) @user = ::User.find_by_user_key(user_key) validate_user! # post json to API response = post_to_api # parse results subscription_path = response.headers['Location'] # create subscription user.arkivo_subscription = subscription_path user.save end |