Class: ActionKitRest::Pages::Base
- Defined in:
- lib/action_kit_rest/pages/base.rb
Direct Known Subclasses
DonationPage, EventCampaignPage, ImportPage, SignupPage, UnsubscribePage
Instance Method Summary collapse
-
#find(name) ⇒ Object
allows finding by name.
- #find_or_create(params) ⇒ Object
Methods inherited from Base
#create, #get, #list, #normalized_base_path, #update
Instance Method Details
#find(name) ⇒ Object
allows finding by name
7 8 9 10 |
# File 'lib/action_kit_rest/pages/base.rb', line 7 def find(name) response = list(name: name) response.obj.first end |
#find_or_create(params) ⇒ Object
12 13 14 15 16 |
# File 'lib/action_kit_rest/pages/base.rb', line 12 def find_or_create(params) page = find(params[:name]) page = create(params) if page.blank? page end |