@@ -166,7 +166,7 @@ def probable_event?(env)
166166 # @raise [CloudEvents::CloudEventsError] if an event could not be decoded
167167 # from the request.
168168 #
169- def decode_event env , allow_opaque : false , **format_args
169+ def decode_event ( env , allow_opaque : false , **format_args )
170170 request_method = env [ "REQUEST_METHOD" ]
171171 raise ( NotCloudEventError , "Request method is #{ request_method } " ) if ILLEGAL_METHODS . include? ( request_method )
172172 content_type_string = env [ "CONTENT_TYPE" ]
@@ -204,7 +204,7 @@ def decode_event env, allow_opaque: false, **format_args
204204 # @param format_args [keywords] Extra args to pass to the formatter.
205205 # @return [Array(headers,String)]
206206 #
207- def encode_event event , structured_format : false , **format_args
207+ def encode_event ( event , structured_format : false , **format_args )
208208 if event . is_a? ( Event ::Opaque )
209209 [ { "Content-Type" => event . content_type . to_s } , event . content ]
210210 elsif !structured_format
@@ -243,7 +243,7 @@ def encode_event event, structured_format: false, **format_args
243243 # @raise [CloudEvents::CloudEventsError] if the request appears to be a
244244 # CloudEvent but decoding failed.
245245 #
246- def decode_rack_env env , **format_args
246+ def decode_rack_env ( env , **format_args )
247247 content_type_string = env [ "CONTENT_TYPE" ]
248248 content_type = ContentType . new ( content_type_string ) if content_type_string
249249 content = read_with_charset ( env [ "rack.input" ] , content_type &.charset )
@@ -262,7 +262,7 @@ def decode_rack_env env, **format_args
262262 # @param format_args [keywords] Extra args to pass to the formatter.
263263 # @return [Array(headers,String)]
264264 #
265- def encode_structured_content event , format_name , **format_args
265+ def encode_structured_content ( event , format_name , **format_args )
266266 result = @event_encoders [ format_name ] &.encode_event ( event : event ,
267267 data_encoder : @data_encoders ,
268268 **format_args )
@@ -280,7 +280,7 @@ def encode_structured_content event, format_name, **format_args
280280 # @param format_args [keywords] Extra args to pass to the formatter.
281281 # @return [Array(headers,String)]
282282 #
283- def encode_batched_content event_batch , format_name , **format_args
283+ def encode_batched_content ( event_batch , format_name , **format_args )
284284 result = @event_encoders [ format_name ] &.encode_event ( event_batch : event_batch ,
285285 data_encoder : @data_encoders ,
286286 **format_args )
@@ -297,7 +297,7 @@ def encode_batched_content event_batch, format_name, **format_args
297297 # @param format_args [keywords] Extra args to pass to the formatter.
298298 # @return [Array(headers,String)]
299299 #
300- def encode_binary_content event , legacy_data_encode : true , **format_args
300+ def encode_binary_content ( event , legacy_data_encode : true , **format_args )
301301 headers = { }
302302 event . to_h . each do |key , value |
303303 unless [ "data" , "data_encoded" , "datacontenttype" ] . include? ( key )
@@ -369,7 +369,7 @@ def add_named_formatter(collection, formatter, name)
369369 # Decode a single event from the given request body and content type in
370370 # structured mode.
371371 #
372- def decode_structured_content content , content_type , allow_opaque , **format_args
372+ def decode_structured_content ( content , content_type , allow_opaque , **format_args )
373373 result = @event_decoders . decode_event ( content : content ,
374374 content_type : content_type ,
375375 data_decoder : @data_decoders ,
@@ -389,7 +389,7 @@ def decode_structured_content content, content_type, allow_opaque, **format_args
389389 # TODO: legacy_data_decode is deprecated and can be removed when
390390 # decode_rack_env is removed.
391391 #
392- def decode_binary_content content , content_type , env , legacy_data_decode , **format_args
392+ def decode_binary_content ( content , content_type , env , legacy_data_decode , **format_args )
393393 spec_version = env [ "HTTP_CE_SPECVERSION" ]
394394 return nil unless spec_version
395395 unless spec_version =~ /^0\. 3|1(\. |$)/
@@ -479,13 +479,13 @@ def read_with_charset(io, charset)
479479 # @private
480480 module DefaultDataFormat
481481 # @private
482- def self . decode_data content : nil , content_type : nil , **_extra_kwargs
482+ def self . decode_data ( content : nil , content_type : nil , **_extra_kwargs )
483483 return nil unless content_type . nil?
484484 { data : content , content_type : nil }
485485 end
486486
487487 # @private
488- def self . encode_data data : nil , content_type : nil , **_extra_kwargs
488+ def self . encode_data ( data : nil , content_type : nil , **_extra_kwargs )
489489 return nil unless content_type . nil?
490490 { content : data . to_s , content_type : nil }
491491 end
0 commit comments