safrano 0.6.3 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33ec32a310f05cb4118e15152f2209aec1551d6363af29eddae28b92d4abf79d
4
- data.tar.gz: 78d6e4c243fc124280ddfc352f0e9376aae269c016bd57b9d9693caff0c7e5c2
3
+ metadata.gz: b71032a7ee1e048867f3b54f57d920ba772a44f29a3419a598d2206d50e949c7
4
+ data.tar.gz: d203df34eda2c7aad9385a84e866d273f1a1f37ba981ffdcc8956de9dad35633
5
5
  SHA512:
6
- metadata.gz: 4344b9959b281e77d830fabf9d812655a50c9560258a5cca3a3364c4569efb10beee34bc7bf0f2fa1b86561fcdff499e40cb3e5a8d819a4b94013870b9a57e91
7
- data.tar.gz: e0027ac6315f9b7ee8e1b948de9c5f1236b01f79638ef3ddcc8adad3a1972091ba5ce52f5bea060ad673581b38a7d00cb4a24ed6aa295c92558e228aabde775f
6
+ metadata.gz: d5cb1583e62f42f9007368204d24f101273049c05e75723dbcd7796732d83e1ac29a1515df0a876a2002c212b0da8204c498070104688fd4b493092072e13dee
7
+ data.tar.gz: 96aa136d330148331b98943807c83b42e466aa7357c8b360b3f5a66843b9472df41015309b2bef19d993bdabf5f4d1d41e983e7082a1f06d34015370bc87a034
@@ -82,7 +82,11 @@ module Safrano
82
82
 
83
83
  # needed for ComplexType result
84
84
  def to_odata_json(_req)
85
- "#{DJ_OPEN}#{@value.odata_h.to_json}#{DJ_CLOSE}"
85
+ t = self.class.klassmod.output_template
86
+ innerh = _req.service.get_entity_odata_h(entity: @value, template: t)
87
+ innerj = innerh.to_json
88
+
89
+ "#{DJ_OPEN}#{innerj}#{DJ_CLOSE}"
86
90
  end
87
91
 
88
92
  # wrapper
@@ -105,7 +109,6 @@ module Safrano
105
109
  end
106
110
 
107
111
  def to_odata_json(req)
108
- # "#{DJ_OPEN}#{{ RESULTSK => coll.map { |c| c.odata_h } }.to_json}#{DJ_CLOSE}"
109
112
  template = self.class.klassmod.output_template
110
113
  # TODO: Error handling if database contains binary BLOB data that cant be
111
114
  # interpreted as UTF-8 then JSON will fail here
@@ -226,7 +229,7 @@ module Safrano
226
229
  end
227
230
 
228
231
  def self.type_name
229
- @namespace ? "#{@namespace}.#{self}" : to_s
232
+ namespace ? "#{namespace}.#{self}" : to_s
230
233
  end
231
234
 
232
235
  def initialize
@@ -69,7 +69,7 @@ module Safrano
69
69
  :Literal
70
70
  when 14
71
71
  :unmatchedQuote
72
- end
72
+ end
73
73
  yield tok, typ
74
74
  break
75
75
  end
@@ -14,12 +14,9 @@ module Safrano
14
14
 
15
15
  def self.cast_values_in(resd, typ)
16
16
  typ.db_schema.each do |f, props|
17
- metadata = typ.cols_metadata[f]
18
-
19
17
  case props[:type]
20
18
  when :datetime, :date
21
19
  fstr = f.to_s
22
- # resd[fstr] = Time.parse(resd[f]) if resd[fstr]
23
20
  resd[fstr] = Sequel.datetime_class.from_edm_json(resd[fstr]) if resd[fstr]
24
21
  end
25
22
  end
@@ -48,7 +45,7 @@ module Safrano
48
45
 
49
46
  if (defered = resd[:__deferred])
50
47
  defered.symbolize_keys!
51
- elsif meta = resd[:__metadata]
48
+ elsif (meta = resd[:__metadata])
52
49
  meta.symbolize_keys!
53
50
 
54
51
  # type is normally namespaced ! --> split.last is the class
@@ -101,7 +98,7 @@ module Safrano
101
98
 
102
99
  if (defered = resd[:__deferred])
103
100
  defered.symbolize_keys!
104
- elsif meta = resd[:__metadata]
101
+ elsif (meta = resd[:__metadata])
105
102
  meta.symbolize_keys!
106
103
 
107
104
  typ = get_class_from_meta(meta)
@@ -336,7 +336,8 @@ module Safrano
336
336
  @complex_types.add ctklass
337
337
  end
338
338
 
339
- def function_import(name)
339
+ def function_import(name_p)
340
+ name = name_p.to_s
340
341
  funcimp = Safrano::FunctionImport(name)
341
342
  @function_imports[name] = funcimp
342
343
  @function_import_keys << name
@@ -365,7 +366,7 @@ module Safrano
365
366
 
366
367
  # need to be sorted by size too
367
368
  def set_funcimports_sorted
368
- @function_import_keys.sort_by! { |k| k.size }.reverse!
369
+ @function_import_keys.sort_by!(&:size).reverse!
369
370
  end
370
371
  # to be called at end of publishing block to ensure we get the right names
371
372
  # and additionally build the list of valid attribute path's used
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Safrano
4
- VERSION = '0.6.3'
4
+ VERSION = '0.6.5'
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.6.3
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - oz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-04 00:00:00.000000000 Z
11
+ date: 2022-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack