simple_service 1.2.5 → 1.2.6

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: 62127eaaf7ab561f13e676804054b5f6c5badb6b
4
- data.tar.gz: 3c707fa3145d309d2ffe402a9083136cb464d0ab
3
+ metadata.gz: 515fadc80305add45e86b396802b338cede2aa06
4
+ data.tar.gz: 841835535e8881c65fa145ae53eecd09bc33b89b
5
5
  SHA512:
6
- metadata.gz: 966251837c81145882975a90ceb9ad88a97e9bcd39d182216e1fc4b0e425f8167d835a87df0bb3c3d43ab83624633a050334b2f46fb7cf35273d97815dd4e7d9
7
- data.tar.gz: 31a500a462b2b4d98b7a49a6470ad93fe977b512744d8861b2d3e1d03536295a002060ab5c4b46ec7b2b10e7b533595bf5f0591f07ac2aeb619540adbae5327a
6
+ metadata.gz: 5b0c5dd85db59e62815ecec3ea749d4f81d0638f10e335da322576613626c8a7cd12a2815d7eeda6c39ee27b4dc43bee0d9c41910075de319a6a09a7053552ac
7
+ data.tar.gz: 2cfc971c8db2575311a893e53cce3f4aca902687eafcb7e68924bee36e8c22a30c9cfb6a85891420dbb3a2f57261cc57660e9a723a1fa46ce4281574f5f70e46
data/README.md CHANGED
@@ -98,6 +98,9 @@ starting_context = {
98
98
  }
99
99
  modified_context = ProcessSomethingComplex.new(starting_context).call
100
100
 
101
+ # alternatively, you can call directly from the service class
102
+ modified_context = ProcessSomethingComplex.call(starting_context)
103
+
101
104
  modified_context[:modified_thing] # => 2
102
105
  ```
103
106
 
@@ -9,6 +9,7 @@ module SimpleService
9
9
  def initialize(context={})
10
10
  @context = context
11
11
 
12
+ symbolize_context_keys
12
13
  setup_call_chain
13
14
  define_getters_and_setters
14
15
  end
@@ -34,6 +34,12 @@ module SimpleService
34
34
  end
35
35
  end
36
36
 
37
+ def symbolize_context_keys
38
+ context.keys.each do |key|
39
+ context[key.to_sym] = context.delete(key)
40
+ end
41
+ end
42
+
37
43
  def find_specified_return_keys
38
44
  if returns.nil? || returns.empty?
39
45
  context
@@ -1,3 +1,3 @@
1
1
  module SimpleService
2
- VERSION = '1.2.5'
2
+ VERSION = '1.2.6'
3
3
  end
@@ -33,6 +33,12 @@ describe SimpleService::Organizer do
33
33
  ).to eql(foo: 'foo', bar: 'bar', baz: 'baz')
34
34
  end
35
35
 
36
+ it 'accepts string keys in context hash' do
37
+ expect(
38
+ TestOrganizer.new('foo' => 'foo').call
39
+ ).to eql(foo: 'foo', bar: 'bar', baz: 'baz')
40
+ end
41
+
36
42
  end
37
43
 
38
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrod Spillers