schemable 0.1.3 → 0.1.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/schemable/version.rb +1 -1
- data/lib/schemable.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f34e140b93c601b0fa6d0baa7bb43d8e77e4276c7419077abad2fce6cbeae820
|
4
|
+
data.tar.gz: b9755ec8abe9cfd3c432945831009410bc256acc82d4ea1efb0a87b72c98e538
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f05de6d4ead3c1ab197b9160e1b97ef0330af0055af54663e02e7e64fe6d91d8b61da67addf75a394e1e1794577618411e5ecd36e0b34ddd9415e3d260d2a731
|
7
|
+
data.tar.gz: 806b59dd5e21d936ca3000445325416caabda85b6788fc8f2cb2a60dfa333037ab75dba40880755bcf6c5632aa95bcb109d26550cea95ca00706820486917a0f
|
data/Gemfile.lock
CHANGED
data/lib/schemable/version.rb
CHANGED
data/lib/schemable.rb
CHANGED
@@ -19,8 +19,8 @@ module Schemable
|
|
19
19
|
text: { type: :string },
|
20
20
|
string: { type: :string },
|
21
21
|
integer: { type: :integer },
|
22
|
-
float: { type: :number, format: :float },
|
23
|
-
decimal: { type: :number, format: :double },
|
22
|
+
float: { type: (configs[:float_as_string] ? :string : :number).to_s.to_sym, format: :float },
|
23
|
+
decimal: { type: (configs[:decimal_as_string] ? :string : :number).to_s.to_sym, format: :double },
|
24
24
|
datetime: { type: :string, format: :'date-time' },
|
25
25
|
date: { type: :string, format: :date },
|
26
26
|
time: { type: :string, format: :time },
|
@@ -932,5 +932,15 @@ module Schemable
|
|
932
932
|
def camelize_keys(hash)
|
933
933
|
hash.deep_transform_keys { |key| key.to_s.camelize(:lower).to_sym }
|
934
934
|
end
|
935
|
+
|
936
|
+
# Returns a json of config options for the definition class.
|
937
|
+
#
|
938
|
+
# @return [Hash] The config options for the definition class.
|
939
|
+
#
|
940
|
+
# @example
|
941
|
+
# { decimal_as_string: true }
|
942
|
+
def configs
|
943
|
+
{}
|
944
|
+
end
|
935
945
|
end
|
936
946
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schemable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muhammad Nawzad
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: factory_bot_rails
|