Class: CampactUserService::PrefillForms
- Inherits:
-
Object
- Object
- CampactUserService::PrefillForms
- Defined in:
- lib/campact_user_service/prefill_forms.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client, account_id) ⇒ PrefillForms
constructor
A new instance of PrefillForms.
- #update_prefill_forms(prefill_forms_state:, campaign_slug:, **additional_params) ⇒ Object
Constructor Details
#initialize(client, account_id) ⇒ PrefillForms
Returns a new instance of PrefillForms.
7 8 9 10 |
# File 'lib/campact_user_service/prefill_forms.rb', line 7 def initialize(client, account_id) @client = client @account_id = account_id end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/campact_user_service/prefill_forms.rb', line 5 def account_id @account_id end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/campact_user_service/prefill_forms.rb', line 5 def client @client end |
Instance Method Details
#update_prefill_forms(prefill_forms_state:, campaign_slug:, **additional_params) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/campact_user_service/prefill_forms.rb', line 12 def update_prefill_forms(prefill_forms_state:, campaign_slug:, **additional_params) params = { prefill_forms: { state: prefill_forms_state, slug: campaign_slug }.merge(additional_params) } path = "/v1/prefill_forms?account_id=#{CGI.escape(account_id.to_s)}" client.patch_request(path, body: params) end |