strum-service 0.2.3 → 0.2.4
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/strum/service/version.rb +1 -1
- data/lib/strum/service.rb +7 -3
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5189e160a086e20e07bdcc593c18334e8a9b821bbc2f4d26567a2f5fcba08067
         | 
| 4 | 
            +
              data.tar.gz: d8d80b04600eeb1b3a2d933b8811d2061b959ff385cee52f1d47d06d60a17aea
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 29510b09777a53d1befe59a80efdb0dca47ed44721e9c3e27c99b6035e3c2084fa6ac5e120f71822e54d9ead423c281c88d1a57f8ef4932dba62504b97e4217b
         | 
| 7 | 
            +
              data.tar.gz: fae7e288048a8b8cadccd9a322b211b6a7e9ccc3d248dba6c13150d31cfb0201634f6a094862f491916783ea18dbd5ab122339053a42912f2937fc11facd54c2
         | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/lib/strum/service.rb
    CHANGED
    
    | @@ -147,7 +147,7 @@ module Strum | |
| 147 147 |  | 
| 148 148 | 
             
                  def required(*keys)
         | 
| 149 149 | 
             
                    if input.is_a?(Hash)
         | 
| 150 | 
            -
                      (keys -  | 
| 150 | 
            +
                      (keys - service_keys).each { |key| add_error(key, :field_must_exist) }
         | 
| 151 151 | 
             
                    else
         | 
| 152 152 | 
             
                      add_error(:input, :must_be_hash)
         | 
| 153 153 | 
             
                    end
         | 
| @@ -155,7 +155,7 @@ module Strum | |
| 155 155 |  | 
| 156 156 | 
             
                  def any(*keys)
         | 
| 157 157 | 
             
                    if input.is_a?(Hash)
         | 
| 158 | 
            -
                      add_error(:input, :any_field_must_exist) unless (keys &  | 
| 158 | 
            +
                      add_error(:input, :any_field_must_exist) unless (keys & service_keys).count.positive?
         | 
| 159 159 | 
             
                    else
         | 
| 160 160 | 
             
                      add_error(:input, :must_be_hash)
         | 
| 161 161 | 
             
                    end
         | 
| @@ -163,7 +163,7 @@ module Strum | |
| 163 163 |  | 
| 164 164 | 
             
                  def sliced(*keys)
         | 
| 165 165 | 
             
                    if input.is_a?(Hash)
         | 
| 166 | 
            -
                      self.input = input.slice(*keys)
         | 
| 166 | 
            +
                      self.input = input.merge(args).slice(*keys)
         | 
| 167 167 | 
             
                    else
         | 
| 168 168 | 
             
                      add_error(:input, :must_be_hash)
         | 
| 169 169 | 
             
                    end
         | 
| @@ -181,6 +181,10 @@ module Strum | |
| 181 181 | 
             
                    end
         | 
| 182 182 | 
             
                  end
         | 
| 183 183 |  | 
| 184 | 
            +
                  def service_keys
         | 
| 185 | 
            +
                    input.keys | args.keys
         | 
| 186 | 
            +
                  end
         | 
| 187 | 
            +
             | 
| 184 188 | 
             
                  def array!
         | 
| 185 189 | 
             
                    self.input = [*input]
         | 
| 186 190 | 
             
                  end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: strum-service
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Serhiy Nazarov
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022- | 
| 11 | 
            +
            date: 2022-07-19 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: Strum Service
         | 
| 14 14 | 
             
            email:
         |