safrano 0.6.4 → 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: 5ac4c570c39b0419c702aef0756ce4c9687916436d5198f768d8dfdedb9bc5fd
4
- data.tar.gz: 3aac760ce6b4bd5e89750e1540024f531593a4cc627663025322cb0e32d60417
3
+ metadata.gz: b71032a7ee1e048867f3b54f57d920ba772a44f29a3419a598d2206d50e949c7
4
+ data.tar.gz: d203df34eda2c7aad9385a84e866d273f1a1f37ba981ffdcc8956de9dad35633
5
5
  SHA512:
6
- metadata.gz: f1e89de14fdacfcd3db0893d0b9e9d00c929da0ba74268d623b235955ed9437e21d2a61454d710886d71aa819625c7ffa8b8f894a69684eace27d51c34d1f05e
7
- data.tar.gz: 954b7c8e764a4c415ba28f34063d7f142876de691cf99c4ce8fc97ad994b2e3adb5faf680cdf4bd7af14b30b6d9a2769fd78fa45ce1b8cc27c7f004bb67a7d51
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)
@@ -337,7 +337,7 @@ module Safrano
337
337
  end
338
338
 
339
339
  def function_import(name_p)
340
- name = "#{name_p}"
340
+ name = name_p.to_s
341
341
  funcimp = Safrano::FunctionImport(name)
342
342
  @function_imports[name] = funcimp
343
343
  @function_import_keys << name
@@ -366,7 +366,7 @@ module Safrano
366
366
 
367
367
  # need to be sorted by size too
368
368
  def set_funcimports_sorted
369
- @function_import_keys.sort_by! { |k| k.size }.reverse!
369
+ @function_import_keys.sort_by!(&:size).reverse!
370
370
  end
371
371
  # to be called at end of publishing block to ensure we get the right names
372
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.4'
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.4
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-12-25 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