action_kit_rest 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +26 -0
  3. data/.travis.yml +7 -1
  4. data/Gemfile +11 -9
  5. data/Rakefile +15 -18
  6. data/action_kit_rest.gemspec +30 -26
  7. data/lib/action_kit_rest.rb +2 -0
  8. data/lib/action_kit_rest/action.rb +3 -1
  9. data/lib/action_kit_rest/actions/event_create_action.rb +5 -3
  10. data/lib/action_kit_rest/actions/event_signup_action.rb +6 -3
  11. data/lib/action_kit_rest/actions/unsubscribe_action.rb +3 -1
  12. data/lib/action_kit_rest/allowed_user_field.rb +3 -1
  13. data/lib/action_kit_rest/api.rb +9 -7
  14. data/lib/action_kit_rest/base.rb +5 -4
  15. data/lib/action_kit_rest/client.rb +5 -3
  16. data/lib/action_kit_rest/event.rb +3 -1
  17. data/lib/action_kit_rest/event_signup.rb +3 -1
  18. data/lib/action_kit_rest/language.rb +3 -1
  19. data/lib/action_kit_rest/list.rb +3 -1
  20. data/lib/action_kit_rest/page.rb +4 -2
  21. data/lib/action_kit_rest/pages/base.rb +4 -5
  22. data/lib/action_kit_rest/pages/donation_page.rb +3 -1
  23. data/lib/action_kit_rest/pages/event_campaign_page.rb +4 -2
  24. data/lib/action_kit_rest/pages/import_page.rb +3 -1
  25. data/lib/action_kit_rest/pages/signup_page.rb +3 -1
  26. data/lib/action_kit_rest/pages/unsubscribe_page.rb +3 -1
  27. data/lib/action_kit_rest/phone.rb +2 -0
  28. data/lib/action_kit_rest/railties.rb +3 -1
  29. data/lib/action_kit_rest/response/collection.rb +4 -4
  30. data/lib/action_kit_rest/response/raise_error.rb +15 -12
  31. data/lib/action_kit_rest/response/validation_error.rb +8 -8
  32. data/lib/action_kit_rest/response/wrapper.rb +10 -10
  33. data/lib/action_kit_rest/tag.rb +6 -6
  34. data/lib/action_kit_rest/user.rb +3 -1
  35. data/lib/action_kit_rest/version.rb +3 -1
  36. data/spec/lib/action_kit_rest/actions/event_create_action_spec.rb +6 -4
  37. data/spec/lib/action_kit_rest/actions/event_signup_action_spec.rb +6 -4
  38. data/spec/lib/action_kit_rest/allowed_user_field_spec.rb +9 -7
  39. data/spec/lib/action_kit_rest/logger_spec.rb +7 -5
  40. data/spec/lib/action_kit_rest/page_spec.rb +28 -28
  41. data/spec/lib/action_kit_rest/pages/event_campaign_page_spec.rb +25 -20
  42. data/spec/lib/action_kit_rest/pages/import_page_spec.rb +21 -17
  43. data/spec/lib/action_kit_rest/response/collection_spec.rb +13 -11
  44. data/spec/lib/action_kit_rest/response/validation_error_spec.rb +6 -4
  45. data/spec/lib/action_kit_rest/response/wrapper_spec.rb +6 -4
  46. data/spec/lib/action_kit_rest/user_spec.rb +11 -9
  47. data/spec/spec_helper.rb +6 -4
  48. data/spec/support/shared_contexts/stub_logger.rb +4 -2
  49. metadata +65 -56
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbbfba05d1d31c87695645c884088600b5fb0d6cf89c4adee504e5772f2e119b
4
- data.tar.gz: 4131f6897ed0d15a973b1baf10808e5ff047fcdeb3df6d75431fe61948eb18ae
3
+ metadata.gz: 719c1f9eff7913a9c74153afcd98ae22b046f641f7ad3a951d05650db38ccb08
4
+ data.tar.gz: 5bf33654f9fd0f7e8c3d305b35bf8864885e6f0b73bd9d8f183e96a295294cae
5
5
  SHA512:
6
- metadata.gz: b462bbcda882136da8c830d4ffb0b961d167a939a739e67cdd03b029cf1fbbaaee9fde59ffea0165c1eacbb04dd3fba4f540895025fac9236fa00900f6fca576
7
- data.tar.gz: 30b02bc5c9d7b38798cda285d424e48c0e8d45f40203648194050ac59c0ff8637ee9638220134225c6b82279d7d98e8a9a03ce149ade7328ac99c18c965141d5
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/.travis.yml CHANGED
@@ -1,3 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.3.4"
3
+ - 2.6
4
+ cache: bundler
5
+ before_install:
6
+ - gem install bundler
7
+ script:
8
+ - bundle exec rspec
9
+ - bundle exec rubocop
data/Gemfile CHANGED
@@ -1,15 +1,17 @@
1
- source "http://rubygems.org"
1
+ # frozen_string_literal: true
2
2
 
3
- gem 'vertebrae', '> 0.5.0'
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'
9
8
  gem 'bundler', '>= 2.0', '<3.0'
10
- gem 'eventmachine', '>=1.2.5', '<2.0'
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 'juwelier', '>=2.4.9', '<3.0'
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
- # encoding: utf-8
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
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
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.rb'
14
-
13
+ require './lib/action_kit_rest/version'
15
14
 
16
15
  require 'juwelier'
17
16
  Juwelier::Tasks.new do |gem|
18
- # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
19
- gem.name = "action_kit_rest"
17
+ gem.name = 'action_kit_rest'
20
18
  gem.version = ActionKitRest::VERSION::STRING
21
- gem.homepage = "http://github.com/controlshift/action_kit_rest"
22
- gem.license = "MIT"
23
- gem.summary = %Q{A wrapper for the ActionKit REST API}
24
- gem.description = %Q{Gem for interacting with the ActionKit API}
25
- gem.email = "systems@controlshiftlabs.com"
26
- gem.authors = ["Nathan Woodhull", 'Diego Marcet', 'Jacinda Moore']
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 :default => :spec
31
+ task default: :spec
35
32
 
36
- desc "Run specs"
33
+ desc 'Run specs'
37
34
  RSpec::Core::RakeTask.new do |t|
38
- t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
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}"
@@ -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.4 ruby lib
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.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, "Jacinda Moore".freeze]
14
- s.date = "2020-04-29"
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",
@@ -89,43 +90,46 @@ Gem::Specification.new do |s|
89
90
  ]
90
91
  s.homepage = "http://github.com/controlshift/action_kit_rest".freeze
91
92
  s.licenses = ["MIT".freeze]
92
- s.rubygems_version = "3.0.4".freeze
93
+ s.rubygems_version = "3.0.8".freeze
93
94
  s.summary = "A wrapper for the ActionKit REST API".freeze
94
95
 
95
96
  if s.respond_to? :specification_version then
96
97
  s.specification_version = 4
97
98
 
98
99
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
99
- s.add_runtime_dependency(%q<vertebrae>.freeze, ["> 0.5.0"])
100
- s.add_development_dependency(%q<rspec>.freeze, ["~> 3.7"])
101
- s.add_development_dependency(%q<webmock>.freeze, ["~> 3.3"])
102
- s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
100
+ s.add_runtime_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
103
101
  s.add_development_dependency(%q<bundler>.freeze, [">= 2.0", "< 3.0"])
104
- s.add_development_dependency(%q<eventmachine>.freeze, [">= 1.2.5", "< 2.0"])
105
- s.add_development_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
102
+ s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
106
103
  s.add_development_dependency(%q<em-http-request>.freeze, [">= 1.1.5", "< 2.0"])
107
- s.add_development_dependency(%q<juwelier>.freeze, [">= 2.4.9", "< 3.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"])
108
110
  else
109
- s.add_dependency(%q<vertebrae>.freeze, ["> 0.5.0"])
110
- s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
111
- s.add_dependency(%q<webmock>.freeze, ["~> 3.3"])
112
- s.add_dependency(%q<byebug>.freeze, [">= 0"])
111
+ s.add_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
113
112
  s.add_dependency(%q<bundler>.freeze, [">= 2.0", "< 3.0"])
114
- s.add_dependency(%q<eventmachine>.freeze, [">= 1.2.5", "< 2.0"])
115
- s.add_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
113
+ s.add_dependency(%q<byebug>.freeze, [">= 0"])
116
114
  s.add_dependency(%q<em-http-request>.freeze, [">= 1.1.5", "< 2.0"])
117
- s.add_dependency(%q<juwelier>.freeze, [">= 2.4.9", "< 3.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"])
118
121
  end
119
122
  else
120
- s.add_dependency(%q<vertebrae>.freeze, ["> 0.5.0"])
121
- s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
122
- s.add_dependency(%q<webmock>.freeze, ["~> 3.3"])
123
- s.add_dependency(%q<byebug>.freeze, [">= 0"])
123
+ s.add_dependency(%q<vertebrae>.freeze, [">= 0.6.0"])
124
124
  s.add_dependency(%q<bundler>.freeze, [">= 2.0", "< 3.0"])
125
- s.add_dependency(%q<eventmachine>.freeze, [">= 1.2.5", "< 2.0"])
126
- s.add_dependency(%q<em-synchrony>.freeze, [">= 1.0.6", "< 2.0"])
125
+ s.add_dependency(%q<byebug>.freeze, [">= 0"])
127
126
  s.add_dependency(%q<em-http-request>.freeze, [">= 1.1.5", "< 2.0"])
128
- s.add_dependency(%q<juwelier>.freeze, [">= 2.4.9", "< 3.0"])
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"])
129
133
  end
130
134
  end
131
135
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vertebrae'
2
4
 
3
5
  module ActionKitRest
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionKitRest
2
4
  class Action < Base
3
5
  def base_path
4
6
  'action'
5
7
  end
6
8
  end
7
- end
9
+ end
@@ -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(/\/rest\/v1\/event\/(\d*)\//)[1]
13
- ak_event_create_action.obj['user_id'] = ak_event_create_action.user.match(/\/rest\/v1\/user\/(\d*)\//)[1]
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'] = ak_event_signup_action.signup.match(/\/rest\/v1\/eventsignup\/(\d*)\//)[1]
13
- ak_event_signup_action.obj['user_id'] = ak_event_signup_action.user.match(/\/rest\/v1\/user\/(\d*)\//)[1]
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
  module Actions
3
5
  class UnsubscribeAction < Action
@@ -6,4 +8,4 @@ module ActionKitRest
6
8
  end
7
9
  end
8
10
  end
9
- end
11
+ 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
@@ -14,7 +16,7 @@ module ActionKitRest
14
16
  # We must override this, because the paths for allowed user fields use the name,
15
17
  # not a numerical ID.
16
18
  def extract_id_from_response(resp)
17
- resp.response.headers["location"].split('/').last
19
+ resp.response.headers['location'].split('/').last
18
20
  end
19
21
  end
20
22
  end
@@ -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( super(*args) )
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.has_key?('data') && params['data'].present?
22
- return params['data']
22
+ if params.key?('data') && params['data'].present?
23
+ params['data']
23
24
  else
24
- return params
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, connection.configuration.password
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 ActionKitRest::Response::RaiseError
51
+ builder.use ActionKitRest::Response::RaiseError
50
52
  builder.adapter connection.configuration.adapter
51
53
  end
52
54
  end
@@ -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["location"])
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(/\/(\d+)\/$/).first.first
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
- [:import, :signup, :donation, :unsubscribe, :event_campaign].each do |page_type|
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
- [:unsubscribe, :event_create, :event_signup].each do |action|
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
- [:action, :page, :tag, :list, :user, :phone, :event, :language, :event_signup, :allowed_user_field].each do |thing|
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionKitRest
2
4
  class Event < Base
3
5
  def base_path
@@ -9,4 +11,4 @@ module ActionKitRest
9
11
  response.obj.first
10
12
  end
11
13
  end
12
- end
14
+ end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ActionKitRest
2
4
  class EventSignup < Base
3
5
  def base_path
4
6
  'eventsignup'
5
7
  end
6
8
  end
7
- end
9
+ end