bmx-event_hook_client_server 1.0.3 → 1.0.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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0e901049720a2543310a586ca7789a2e00ae0d18a03a9c7638d9a15a8c5e955c
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0bf216b9852132a370680a21633542aba5b8ef15eda7f78208852c2ff8a63b53
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: eee9f04e4997a0293bb88b3d6358aab20b069a64a6268fd7b3c6b04029093940d32a2a4442dc3fd334b4623795ddea93b6b97b2376c34598b5218322f3096c69
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b26407a27bd6eda16e4cdd95045b7d5f71f8a65cf4f45781d2a3da2895dc981660b470de22c3c040f7e91f490693fc1ae85dda80ab4481d0210715299fb43eb7
         
     | 
| 
         @@ -4,6 +4,60 @@ module EventHookClientServer 
     | 
|
| 
       4 
4 
     | 
    
         
             
              module Refinements
         
     | 
| 
       5 
5 
     | 
    
         
             
                module Protobuf
         
     | 
| 
       6 
6 
     | 
    
         
             
                  module HashableStructValues
         
     | 
| 
      
 7 
     | 
    
         
            +
                    message_klasses =
         
     | 
| 
      
 8 
     | 
    
         
            +
                      ObjectSpace
         
     | 
| 
      
 9 
     | 
    
         
            +
                      .each_object(Class)
         
     | 
| 
      
 10 
     | 
    
         
            +
                      .select { |klass| klass < Google::Protobuf::MessageExts }
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                    message_klasses.each do |klass|
         
     | 
| 
      
 13 
     | 
    
         
            +
                      refine klass do
         
     | 
| 
      
 14 
     | 
    
         
            +
                        def to_h
         
     | 
| 
      
 15 
     | 
    
         
            +
                          return to_a if self.class == Google::Protobuf::RepeatedField
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
                          keys = self.class.descriptor.map(&:name)
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                          keys.each_with_object({}) do |key, hash|
         
     | 
| 
      
 20 
     | 
    
         
            +
                            value = send(key)
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                            hash[key.to_sym] =
         
     | 
| 
      
 23 
     | 
    
         
            +
                              if value.is_a?(Google::Protobuf::MessageExts)
         
     | 
| 
      
 24 
     | 
    
         
            +
                                value.to_h
         
     | 
| 
      
 25 
     | 
    
         
            +
                              elsif value.class == Google::Protobuf::RepeatedField
         
     | 
| 
      
 26 
     | 
    
         
            +
                                value.to_a
         
     | 
| 
      
 27 
     | 
    
         
            +
                              else
         
     | 
| 
      
 28 
     | 
    
         
            +
                                value
         
     | 
| 
      
 29 
     | 
    
         
            +
                              end
         
     | 
| 
      
 30 
     | 
    
         
            +
                          end
         
     | 
| 
      
 31 
     | 
    
         
            +
                        end
         
     | 
| 
      
 32 
     | 
    
         
            +
                      end
         
     | 
| 
      
 33 
     | 
    
         
            +
                    end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                    refine Google::Protobuf::RepeatedField do
         
     | 
| 
      
 37 
     | 
    
         
            +
                      def to_a
         
     | 
| 
      
 38 
     | 
    
         
            +
                        puts 'ARRAY'
         
     | 
| 
      
 39 
     | 
    
         
            +
                        map do |value|
         
     | 
| 
      
 40 
     | 
    
         
            +
                          if value.is_a?(Google::Protobuf::MessageExts)
         
     | 
| 
      
 41 
     | 
    
         
            +
                            value.to_h
         
     | 
| 
      
 42 
     | 
    
         
            +
                          elsif value.class == Google::Protobuf::RepeatedField
         
     | 
| 
      
 43 
     | 
    
         
            +
                            value.to_a
         
     | 
| 
      
 44 
     | 
    
         
            +
                          else
         
     | 
| 
      
 45 
     | 
    
         
            +
                            value
         
     | 
| 
      
 46 
     | 
    
         
            +
                          end
         
     | 
| 
      
 47 
     | 
    
         
            +
                        end
         
     | 
| 
      
 48 
     | 
    
         
            +
                      end
         
     | 
| 
      
 49 
     | 
    
         
            +
                    end
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
                    refine Google::Protobuf::StringValue do
         
     | 
| 
      
 52 
     | 
    
         
            +
                      def to_h
         
     | 
| 
      
 53 
     | 
    
         
            +
                        hash = super
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                        return unless hash
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
                        hash[:value]
         
     | 
| 
      
 58 
     | 
    
         
            +
                      end
         
     | 
| 
      
 59 
     | 
    
         
            +
                    end
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
       7 
61 
     | 
    
         
             
                    refine Google::Protobuf::Struct do
         
     | 
| 
       8 
62 
     | 
    
         
             
                      def to_h
         
     | 
| 
       9 
63 
     | 
    
         
             
                        fields.each_with_object({}) do |(key, value), hash|
         
     |