portatext 1.5.15 → 1.5.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 980487b99d733f520127261981924d735ce8ead7
4
- data.tar.gz: 2edfe7c45a131b23a9c0567b4d11ace2479df845
3
+ metadata.gz: c9a613ab3f296136776a5b7bdca29f16175d1dd2
4
+ data.tar.gz: 995f9d560be9fc24f7bc49fa23880ca3553e17af
5
5
  SHA512:
6
- metadata.gz: bcb63275b3b7f81818422682cb705b157be84bf21f8128f03fa17a26eb3750983afadd879c059f4397e50255d51c5c84cb9c4d0ab32e1bf2ff89b0a5f63c8dce
7
- data.tar.gz: 0ab0c9c37cf6dac0aab02986897529e2862bdbd9b301722edd945d375c886263aa76150a609b5b33bed5af501d60fb4aae777482a31142a3d990bb1fc43cdb45
6
+ metadata.gz: 062c2e0926f55403fe70721e5da14ccc90137fd747ebdeeca88411cccfd39211daf53f3e6c840a9959efcfd4e2a32a06e822199345fa578a847cbe159163792e
7
+ data.tar.gz: 61a95f76b368bb6b665d315e8f1fb290493052937598459a92dc604699f68e9097f9c81857f4f2814a609130c7cc8d643d1ff8c67f66746a0f53b433feff9a7d
@@ -16,17 +16,26 @@ module PortaText
16
16
  attr_writer :executor
17
17
  attr_writer :logger
18
18
 
19
+ def respond_to_missing?(method, *_arguments, &_block)
20
+ defined?(command_class_name method) || super
21
+ end
22
+
19
23
  def method_missing(method, *_arguments, &_block)
20
- method = method.to_s.split('_').map(&:capitalize)
21
- class_name = Object.const_get('PortaText')
22
- .const_get('Command')
23
- .const_get('Api')
24
- .const_get(method.join(''))
24
+ class_name = command_class_name(method)
25
+ super unless defined?(class_name)
25
26
  command = class_name.new
26
27
  command.client = self
27
28
  command
28
29
  end
29
30
 
31
+ def command_class_name(method)
32
+ method = method.to_s.split('_').map(&:capitalize)
33
+ Object.const_get('PortaText')
34
+ .const_get('Command')
35
+ .const_get('Api')
36
+ .const_get(method.join(''))
37
+ end
38
+
30
39
  # rubocop:disable Metrics/MethodLength
31
40
  # rubocop:disable Metrics/AbcSize
32
41
  # rubocop:disable Metrics/ParameterLists
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'portatext'
3
- s.version = '1.5.15'
3
+ s.version = '1.5.16'
4
4
  s.summary = 'Official PortaText API ruby client'
5
5
  s.description = 'This is the official PortaText API ruby client'
6
6
  s.authors = ['PortaText']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portatext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.15
4
+ version: 1.5.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - PortaText