safrano 0.8.6 → 0.8.7

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: f9adaeb39e8d4bad178c27eea1c185e9a57f557629658528fca362cd8bd531b8
4
- data.tar.gz: f074ed4fe82f9986d046205212c96bedd4f690773959824b47595d18a1590cf8
3
+ metadata.gz: d2eed096c2669da58d766a50abb6361f96003f8489367bcd4ab784e7a7306410
4
+ data.tar.gz: 991dbed63c5ceeda823024f9af0ea796a0aad5145c8549ad7cd114222b5ec973
5
5
  SHA512:
6
- metadata.gz: 994ffc1c45f7e99c48b5d3e6b90562036fee5041fcaa5589c4b6fa529ae166f90a961b5dfee56d7e9c2cc1378c60a9aa829e9bf4d6b0cdcab350c1837d223c1d
7
- data.tar.gz: 17c25445bdc124986a5be66d3d8f129b4848534d5ad43a1db1b1cf8214a9e1018ded1f085ee7d5de2575b2c2737f1814960091c208847d27aef9f5a549d24b41
6
+ metadata.gz: 7722469a7e2a9cbfda56d955c3cd2efb97e07d881ac4738e61971b522a642ed8aae9bb387fcc8e625b19e8317cbd4fa57d073c01e2dfe93c88667e23b8a4c914
7
+ data.tar.gz: '06795fce287398b3f1087d5331427bd95db54359b84ca454304033285e6e8e73f289ac704364f4eb43c1f1f6cdb536e1378a58f14847eebd02a892dcb128bb7f'
data/lib/odata/entity.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'json'
4
4
  require 'rexml/document'
5
- require 'safrano'
6
5
  require 'odata/model_ext' # required for self.class.entity_type_name ??
6
+
7
7
  require_relative 'navigation_attribute'
8
8
 
9
9
  module Safrano
@@ -153,7 +153,7 @@ module Safrano
153
153
  attr_reader :function_import_keys
154
154
  attr_reader :type_mappings
155
155
  attr_reader :final_template_func
156
- attr_reader :response_format_options
156
+ attr_reader :xresponse_format_options # added x to differentiate from DSL function
157
157
 
158
158
  # Instance attributes for specialized Version specific Instances
159
159
  attr_reader :v1
@@ -180,7 +180,7 @@ module Safrano
180
180
  @function_import_keys = []
181
181
  @cmap = {}
182
182
  @type_mappings = {}
183
- @response_format_options = []
183
+ @xresponse_format_options = []
184
184
  @final_template_func = FINAL_TEMPLATE_FUNC_DEFAULT
185
185
  # enabled per default starting from 0.6
186
186
  @xbugfix_create_response = true
@@ -203,7 +203,7 @@ module Safrano
203
203
  @function_import_keys = template_instance.function_import_keys.dup
204
204
  @cmap = template_instance.cmap.dup
205
205
  @type_mappings = template_instance.type_mappings.dup
206
- @response_format_options = template_instance.response_format_options.dup
206
+ @xresponse_format_options = template_instance.xresponse_format_options.dup
207
207
  @final_template_func = template_instance.final_template_func.dup
208
208
  @xbugfix_create_response = template_instance.xbugfix_create_response.dup
209
209
  @xpath_prefix = template_instance.xpath_prefix.dup
@@ -293,6 +293,8 @@ module Safrano
293
293
 
294
294
  VALID_RESP_FORMAT_OPTS = [:skip_deferred, :skip_metadata]
295
295
  def valid_resp_format_options(*args)
296
+ raise API::InvalidRespFormatOption.new(args) unless args
297
+
296
298
  args.map!(&:to_sym)
297
299
  args.each { |arg|
298
300
  raise API::InvalidRespFormatOption.new(arg) unless VALID_RESP_FORMAT_OPTS.include?(arg)
@@ -302,7 +304,7 @@ module Safrano
302
304
 
303
305
  def response_format_options(*args)
304
306
  valid_resp_format_options(*args) do |vargs|
305
- @response_format_options = vargs.dup
307
+ @xresponse_format_options = vargs.dup
306
308
  process_response_format_options
307
309
  @v1.response_format_options(*vargs) if @v1
308
310
  @v2.response_format_options(*vargs) if @v2
@@ -317,12 +319,12 @@ module Safrano
317
319
 
318
320
  # end public API
319
321
  def process_response_format_options
320
- @final_template_func = if (@response_format_options.include?(:skip_metadata) &&
321
- @response_format_options.include?(:skip_deferred))
322
+ @final_template_func = if (@xresponse_format_options.include?(:skip_metadata) &&
323
+ @xresponse_format_options.include?(:skip_deferred))
322
324
  FINAL_TEMPLATE_FUNC_SKIP_META_DEFERR
323
- elsif @response_format_options.include?(:skip_metadata)
325
+ elsif @xresponse_format_options.include?(:skip_metadata)
324
326
  FINAL_TEMPLATE_FUNC_SKIP_META
325
- elsif @response_format_options.include?(:skip_deferred)
327
+ elsif @xresponse_format_options.include?(:skip_deferred)
326
328
  FINAL_TEMPLATE_FUNC_SKIP_DEFERR
327
329
  else
328
330
  FINAL_TEMPLATE_FUNC_DEFAULT
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Safrano
4
- VERSION = '0.8.6'
4
+ VERSION = '0.8.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - oz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-26 00:00:00.000000000 Z
11
+ date: 2025-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack