action_kit_rest 0.4.0 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +26 -0
- data/.ruby-version +1 -1
- data/.travis.yml +7 -1
- data/Gemfile +11 -9
- data/Rakefile +15 -18
- data/action_kit_rest.gemspec +39 -23
- data/lib/action_kit_rest.rb +2 -0
- data/lib/action_kit_rest/action.rb +3 -1
- data/lib/action_kit_rest/actions/event_create_action.rb +5 -3
- data/lib/action_kit_rest/actions/event_signup_action.rb +6 -3
- data/lib/action_kit_rest/actions/unsubscribe_action.rb +3 -1
- data/lib/action_kit_rest/allowed_user_field.rb +10 -0
- data/lib/action_kit_rest/api.rb +9 -7
- data/lib/action_kit_rest/base.rb +5 -4
- data/lib/action_kit_rest/client.rb +5 -3
- data/lib/action_kit_rest/event.rb +3 -1
- data/lib/action_kit_rest/event_signup.rb +3 -1
- data/lib/action_kit_rest/language.rb +3 -1
- data/lib/action_kit_rest/list.rb +3 -1
- data/lib/action_kit_rest/page.rb +4 -2
- data/lib/action_kit_rest/pages/base.rb +4 -5
- data/lib/action_kit_rest/pages/donation_page.rb +3 -1
- data/lib/action_kit_rest/pages/event_campaign_page.rb +4 -2
- data/lib/action_kit_rest/pages/import_page.rb +3 -1
- data/lib/action_kit_rest/pages/signup_page.rb +3 -1
- data/lib/action_kit_rest/pages/unsubscribe_page.rb +3 -1
- data/lib/action_kit_rest/phone.rb +2 -0
- data/lib/action_kit_rest/railties.rb +3 -1
- data/lib/action_kit_rest/response/collection.rb +4 -4
- data/lib/action_kit_rest/response/raise_error.rb +15 -12
- data/lib/action_kit_rest/response/validation_error.rb +7 -0
- data/lib/action_kit_rest/response/wrapper.rb +10 -10
- data/lib/action_kit_rest/tag.rb +6 -6
- data/lib/action_kit_rest/user.rb +3 -1
- data/lib/action_kit_rest/version.rb +3 -1
- data/spec/fixtures/allowed_user_field/get.json +19 -0
- data/spec/lib/action_kit_rest/actions/event_create_action_spec.rb +6 -4
- data/spec/lib/action_kit_rest/actions/event_signup_action_spec.rb +6 -4
- data/spec/lib/action_kit_rest/allowed_user_field_spec.rb +43 -5
- data/spec/lib/action_kit_rest/logger_spec.rb +7 -5
- data/spec/lib/action_kit_rest/page_spec.rb +28 -28
- data/spec/lib/action_kit_rest/pages/event_campaign_page_spec.rb +25 -20
- data/spec/lib/action_kit_rest/pages/import_page_spec.rb +21 -17
- data/spec/lib/action_kit_rest/response/collection_spec.rb +13 -11
- data/spec/lib/action_kit_rest/response/validation_error_spec.rb +29 -0
- data/spec/lib/action_kit_rest/response/wrapper_spec.rb +6 -4
- data/spec/lib/action_kit_rest/user_spec.rb +11 -9
- data/spec/spec_helper.rb +6 -4
- data/spec/support/shared_contexts/stub_logger.rb +4 -2
- metadata +64 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 719c1f9eff7913a9c74153afcd98ae22b046f641f7ad3a951d05650db38ccb08
|
4
|
+
data.tar.gz: 5bf33654f9fd0f7e8c3d305b35bf8864885e6f0b73bd9d8f183e96a295294cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d949bf41d12791611c0893826515620f8e89630828709b8d6b22f64aaf11adc2bf549e3c2cb3166fd7d35429ca3073e42d9251dd1801c07770f879001610edbe
|
7
|
+
data.tar.gz: f2f7fed453b3518d7114b28b4d6b4f25fe1506a40ca8e0e24963ffa4eac1ce5dc5193beef908058677a8478277dd7c4b5533df403d5920391fb7b08474675cc9
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisabledByDefault: true
|
3
|
+
|
4
|
+
Security:
|
5
|
+
Enabled: true
|
6
|
+
|
7
|
+
Bundler/DuplicatedGem:
|
8
|
+
Enabled: true
|
9
|
+
Bundler/InsecureProtocolSource:
|
10
|
+
Enabled: true
|
11
|
+
Layout/IndentationStyle:
|
12
|
+
Enabled: true
|
13
|
+
Layout/SpaceInsideRangeLiteral:
|
14
|
+
Enabled: true
|
15
|
+
Lint:
|
16
|
+
Enabled: true
|
17
|
+
Lint/RaiseException:
|
18
|
+
Enabled: true
|
19
|
+
Naming/AsciiIdentifiers:
|
20
|
+
Enabled: true
|
21
|
+
Naming/ClassAndModuleCamelCase:
|
22
|
+
Enabled: true
|
23
|
+
Naming/ConstantName:
|
24
|
+
Enabled: true
|
25
|
+
Naming/FileName:
|
26
|
+
Enabled: true
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.6
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
source 'http://rubygems.org'
|
4
|
+
|
5
|
+
gem 'vertebrae', '>= 0.6.0'
|
4
6
|
|
5
7
|
group :development do
|
6
|
-
gem 'rspec', '~> 3.7'
|
7
|
-
gem 'webmock', '~> 3.3'
|
8
|
-
gem 'byebug', '>= 10.0.2', '<11.0'
|
9
8
|
gem 'bundler', '>= 2.0', '<3.0'
|
10
|
-
gem '
|
11
|
-
gem 'em-synchrony', '>=1.0.6', '<2.0'
|
9
|
+
gem 'byebug'
|
12
10
|
gem 'em-http-request', '>=1.1.5', '<2.0'
|
13
|
-
gem '
|
11
|
+
gem 'em-synchrony', '>=1.0.6', '<2.0'
|
12
|
+
gem 'eventmachine', '>=1.2.5', '<2.0'
|
13
|
+
gem 'juwelier', git: 'https://github.com/flajann2/juwelier.git'
|
14
|
+
gem 'rspec', '~> 3.7'
|
15
|
+
gem 'rubocop'
|
16
|
+
gem 'webmock', '~> 3.3'
|
14
17
|
end
|
15
|
-
|
data/Rakefile
CHANGED
@@ -1,47 +1,44 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'bundler'
|
5
5
|
begin
|
6
6
|
Bundler.setup(:default, :development)
|
7
7
|
rescue Bundler::BundlerError => e
|
8
|
-
|
9
|
-
|
8
|
+
warn e.message
|
9
|
+
warn 'Run `bundle install` to install missing gems'
|
10
10
|
exit e.status_code
|
11
11
|
end
|
12
12
|
require 'rake'
|
13
|
-
require './lib/action_kit_rest/version
|
14
|
-
|
13
|
+
require './lib/action_kit_rest/version'
|
15
14
|
|
16
15
|
require 'juwelier'
|
17
16
|
Juwelier::Tasks.new do |gem|
|
18
|
-
|
19
|
-
gem.name = "action_kit_rest"
|
17
|
+
gem.name = 'action_kit_rest'
|
20
18
|
gem.version = ActionKitRest::VERSION::STRING
|
21
|
-
gem.homepage =
|
22
|
-
gem.license =
|
23
|
-
gem.summary = %
|
24
|
-
gem.description = %
|
25
|
-
gem.email =
|
26
|
-
gem.authors = [
|
19
|
+
gem.homepage = 'http://github.com/controlshift/action_kit_rest'
|
20
|
+
gem.license = 'MIT'
|
21
|
+
gem.summary = %(A wrapper for the ActionKit REST API)
|
22
|
+
gem.description = %(Gem for interacting with the ActionKit API)
|
23
|
+
gem.email = 'systems@controlshiftlabs.com'
|
24
|
+
gem.authors = ['Nathan Woodhull', 'Diego Marcet', 'Grey Moore']
|
27
25
|
# dependencies defined in Gemfile
|
28
26
|
end
|
29
27
|
Juwelier::RubygemsDotOrgTasks.new
|
30
28
|
|
31
|
-
|
32
29
|
require 'rspec/core/rake_task'
|
33
30
|
desc 'Default: run specs.'
|
34
|
-
task :
|
31
|
+
task default: :spec
|
35
32
|
|
36
|
-
desc
|
33
|
+
desc 'Run specs'
|
37
34
|
RSpec::Core::RakeTask.new do |t|
|
38
|
-
t.pattern =
|
35
|
+
t.pattern = './spec/**/*_spec.rb' # don't need this, it's default.
|
39
36
|
t.rspec_opts = '--color'
|
40
37
|
end
|
41
38
|
|
42
39
|
require 'rdoc/task'
|
43
40
|
Rake::RDocTask.new do |rdoc|
|
44
|
-
version = File.exist?('VERSION') ? File.read('VERSION') :
|
41
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ''
|
45
42
|
|
46
43
|
rdoc.rdoc_dir = 'rdoc'
|
47
44
|
rdoc.title = "action_kit_rest #{version}"
|
data/action_kit_rest.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: action_kit_rest 0.4.
|
5
|
+
# stub: action_kit_rest 0.4.5 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "action_kit_rest".freeze
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.5"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
|
-
s.authors = ["Nathan Woodhull".freeze, "Diego Marcet".freeze, "
|
14
|
-
s.date = "
|
13
|
+
s.authors = ["Nathan Woodhull".freeze, "Diego Marcet".freeze, "Grey Moore".freeze]
|
14
|
+
s.date = "2021-03-23"
|
15
15
|
s.description = "Gem for interacting with the ActionKit API".freeze
|
16
16
|
s.email = "systems@controlshiftlabs.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
23
|
".rspec",
|
24
|
+
".rubocop.yml",
|
24
25
|
".ruby-gemset",
|
25
26
|
".ruby-version",
|
26
27
|
".travis.yml",
|
@@ -60,6 +61,7 @@ Gem::Specification.new do |s|
|
|
60
61
|
"lib/action_kit_rest/version.rb",
|
61
62
|
"spec/fixtures/action/event_create_action.json",
|
62
63
|
"spec/fixtures/action/event_signup_action.json",
|
64
|
+
"spec/fixtures/allowed_user_field/get.json",
|
63
65
|
"spec/fixtures/allowed_user_field/list.json",
|
64
66
|
"spec/fixtures/allowed_user_field/list_filtered.json",
|
65
67
|
"spec/fixtures/error.json",
|
@@ -80,6 +82,7 @@ Gem::Specification.new do |s|
|
|
80
82
|
"spec/lib/action_kit_rest/pages/event_campaign_page_spec.rb",
|
81
83
|
"spec/lib/action_kit_rest/pages/import_page_spec.rb",
|
82
84
|
"spec/lib/action_kit_rest/response/collection_spec.rb",
|
85
|
+
"spec/lib/action_kit_rest/response/validation_error_spec.rb",
|
83
86
|
"spec/lib/action_kit_rest/response/wrapper_spec.rb",
|
84
87
|
"spec/lib/action_kit_rest/user_spec.rb",
|
85
88
|
"spec/spec_helper.rb",
|
@@ -87,33 +90,46 @@ Gem::Specification.new do |s|
|
|
87
90
|
]
|
88
91
|
s.homepage = "http://github.com/controlshift/action_kit_rest".freeze
|
89
92
|
s.licenses = ["MIT".freeze]
|
90
|
-
s.rubygems_version = "3.
|
93
|
+
s.rubygems_version = "3.0.8".freeze
|
91
94
|
s.summary = "A wrapper for the ActionKit REST API".freeze
|
92
95
|
|
93
96
|
if s.respond_to? :specification_version then
|
94
97
|
s.specification_version = 4
|
95
|
-
end
|
96
98
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
99
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
100
|
+
s.add_runtime_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
|
101
|
+
s.add_development_dependency(%q<bundler>.freeze, [">= 2.0", "< 3.0"])
|
102
|
+
s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
|
103
|
+
s.add_development_dependency(%q<em-http-request>.freeze, [">= 1.1.5", "< 2.0"])
|
104
|
+
s.add_development_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
|
105
|
+
s.add_development_dependency(%q<eventmachine>.freeze, [">= 1.2.5", "< 2.0"])
|
106
|
+
s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
|
107
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.7"])
|
108
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
|
109
|
+
s.add_development_dependency(%q<webmock>.freeze, ["~> 3.3"])
|
110
|
+
else
|
111
|
+
s.add_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
|
112
|
+
s.add_dependency(%q<bundler>.freeze, [">= 2.0", "< 3.0"])
|
113
|
+
s.add_dependency(%q<byebug>.freeze, [">= 0"])
|
114
|
+
s.add_dependency(%q<em-http-request>.freeze, [">= 1.1.5", "< 2.0"])
|
115
|
+
s.add_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
|
116
|
+
s.add_dependency(%q<eventmachine>.freeze, [">= 1.2.5", "< 2.0"])
|
117
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
118
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
|
119
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
120
|
+
s.add_dependency(%q<webmock>.freeze, ["~> 3.3"])
|
121
|
+
end
|
107
122
|
else
|
108
|
-
s.add_dependency(%q<vertebrae>.freeze, ["
|
109
|
-
s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
|
110
|
-
s.add_dependency(%q<webmock>.freeze, ["~> 3.3"])
|
111
|
-
s.add_dependency(%q<byebug>.freeze, [">= 10.0.2", "< 11.0"])
|
123
|
+
s.add_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
|
112
124
|
s.add_dependency(%q<bundler>.freeze, [">= 2.0", "< 3.0"])
|
113
|
-
s.add_dependency(%q<
|
114
|
-
s.add_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
|
125
|
+
s.add_dependency(%q<byebug>.freeze, [">= 0"])
|
115
126
|
s.add_dependency(%q<em-http-request>.freeze, [">= 1.1.5", "< 2.0"])
|
116
|
-
s.add_dependency(%q<
|
127
|
+
s.add_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
|
128
|
+
s.add_dependency(%q<eventmachine>.freeze, [">= 1.2.5", "< 2.0"])
|
129
|
+
s.add_dependency(%q<juwelier>.freeze, [">= 0"])
|
130
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
|
131
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
132
|
+
s.add_dependency(%q<webmock>.freeze, ["~> 3.3"])
|
117
133
|
end
|
118
134
|
end
|
119
135
|
|
data/lib/action_kit_rest.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionKitRest
|
2
4
|
module Actions
|
3
5
|
class EventCreateAction < Action
|
@@ -9,11 +11,11 @@ module ActionKitRest
|
|
9
11
|
ak_event_create_action = super
|
10
12
|
|
11
13
|
# Aggregate fields parsed from referrenced entities' URI
|
12
|
-
ak_event_create_action.obj['event_id'] = ak_event_create_action.event.match(
|
13
|
-
ak_event_create_action.obj['user_id'] = ak_event_create_action.user.match(
|
14
|
+
ak_event_create_action.obj['event_id'] = ak_event_create_action.event.match(%r{/rest/v1/event/(\d*)/})[1]
|
15
|
+
ak_event_create_action.obj['user_id'] = ak_event_create_action.user.match(%r{/rest/v1/user/(\d*)/})[1]
|
14
16
|
|
15
17
|
ak_event_create_action
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
19
|
-
end
|
21
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionKitRest
|
2
4
|
module Actions
|
3
5
|
class EventSignupAction < Action
|
@@ -9,11 +11,12 @@ module ActionKitRest
|
|
9
11
|
ak_event_signup_action = super
|
10
12
|
|
11
13
|
# Aggregate fields parsed from referrenced entities' URI
|
12
|
-
ak_event_signup_action.obj['event_signup_id'] =
|
13
|
-
|
14
|
+
ak_event_signup_action.obj['event_signup_id'] =
|
15
|
+
ak_event_signup_action.signup.match(%r{/rest/v1/eventsignup/(\d*)/})[1]
|
16
|
+
ak_event_signup_action.obj['user_id'] = ak_event_signup_action.user.match(%r{/rest/v1/user/(\d*)/})[1]
|
14
17
|
|
15
18
|
ak_event_signup_action
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
19
|
-
end
|
22
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionKitRest
|
2
4
|
class AllowedUserField < Base
|
3
5
|
def base_path
|
@@ -8,5 +10,13 @@ module ActionKitRest
|
|
8
10
|
response = list(name: name)
|
9
11
|
response.obj.first
|
10
12
|
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
# We must override this, because the paths for allowed user fields use the name,
|
17
|
+
# not a numerical ID.
|
18
|
+
def extract_id_from_response(resp)
|
19
|
+
resp.response.headers['location'].split('/').last
|
20
|
+
end
|
11
21
|
end
|
12
22
|
end
|
data/lib/action_kit_rest/api.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionKitRest
|
2
4
|
class API < Vertebrae::API
|
3
|
-
|
4
5
|
def request(*args)
|
5
|
-
ActionKitRest::Response::Wrapper.new(
|
6
|
+
ActionKitRest::Response::Wrapper.new(super(*args))
|
6
7
|
end
|
7
8
|
|
8
9
|
def post_json_request(path, params)
|
@@ -18,10 +19,10 @@ module ActionKitRest
|
|
18
19
|
end
|
19
20
|
|
20
21
|
def extract_data_from_params(params) # :nodoc:
|
21
|
-
if params.
|
22
|
-
|
22
|
+
if params.key?('data') && params['data'].present?
|
23
|
+
params['data']
|
23
24
|
else
|
24
|
-
|
25
|
+
params
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
@@ -38,7 +39,8 @@ module ActionKitRest
|
|
38
39
|
builder.use Faraday::Request::Multipart
|
39
40
|
builder.use Faraday::Request::UrlEncoded
|
40
41
|
if connection.configuration.authenticated?
|
41
|
-
builder.use Faraday::Request::BasicAuthentication, connection.configuration.username,
|
42
|
+
builder.use Faraday::Request::BasicAuthentication, connection.configuration.username,
|
43
|
+
connection.configuration.password
|
42
44
|
end
|
43
45
|
|
44
46
|
builder.use Faraday::Response::Logger if ENV['DEBUG']
|
@@ -46,7 +48,7 @@ module ActionKitRest
|
|
46
48
|
builder.use FaradayMiddleware::Mashify
|
47
49
|
builder.use FaradayMiddleware::ParseJson
|
48
50
|
|
49
|
-
builder.use
|
51
|
+
builder.use ActionKitRest::Response::RaiseError
|
50
52
|
builder.adapter connection.configuration.adapter
|
51
53
|
end
|
52
54
|
end
|
data/lib/action_kit_rest/base.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionKitRest
|
2
4
|
class Base < Vertebrae::Model
|
3
|
-
|
4
5
|
def list(filters = {})
|
5
6
|
client.get_request(normalized_base_path, filters)
|
6
7
|
end
|
@@ -31,11 +32,11 @@ module ActionKitRest
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def extract_id_from_response(resp)
|
34
|
-
extract_id_from_location(resp.response.headers[
|
35
|
+
extract_id_from_location(resp.response.headers['location'])
|
35
36
|
end
|
36
37
|
|
37
38
|
def extract_id_from_location(location)
|
38
|
-
location.scan(
|
39
|
+
location.scan(%r{/(\d+)/$}).first.first
|
39
40
|
end
|
40
41
|
end
|
41
|
-
end
|
42
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'action_kit_rest/api'
|
2
4
|
|
3
5
|
module ActionKitRest
|
@@ -9,19 +11,19 @@ module ActionKitRest
|
|
9
11
|
self.clients = {}
|
10
12
|
end
|
11
13
|
|
12
|
-
[
|
14
|
+
%i[import signup donation unsubscribe event_campaign].each do |page_type|
|
13
15
|
define_method "#{page_type}_page" do
|
14
16
|
clients["#{page_type}_page"] ||= ("ActionKitRest::Pages::#{page_type.to_s.classify}Page".constantize).new(client: self)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
[
|
20
|
+
%i[unsubscribe event_create event_signup].each do |action|
|
19
21
|
define_method "#{action}_action" do
|
20
22
|
clients["#{action}_action"] ||= ("ActionKitRest::Actions::#{action.to_s.classify}Action".constantize).new(client: self)
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
[
|
26
|
+
%i[action page tag list user phone event language event_signup allowed_user_field].each do |thing|
|
25
27
|
define_method thing do
|
26
28
|
clients[thing] ||= ("ActionKitRest::#{thing.to_s.classify}".constantize).new(client: self)
|
27
29
|
end
|