datory 1.0.0.rc5 → 1.0.0.rc7

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: 6f0d3dcd343bb011dc9a4f364a9d62b14deaa0920c48495a48c36ed23d08143e
4
- data.tar.gz: c299b7365488894f8467c094f3e11445fde073eab82b14d45ff63c284a98f67f
3
+ metadata.gz: 992667eaefb8dcff761e0825d44819b40bd11c899c951cdca0fca3ae6d3723cc
4
+ data.tar.gz: dd68e1829262596d46501c04d2a3e70099bd304a531c1d5a36fd6cd6f4c70633
5
5
  SHA512:
6
- metadata.gz: b7a458af89e5be1b6ca35f1064da7deb50a8da75751cce60d4c7bf5b93cc559c20ab6ea13156667e2be8e0d984ebebef82c2bc1a08f5c2f6fc7bccca9d9d6dfd
7
- data.tar.gz: abaf617dcbcaf4d8e6661cca45fb39ec17d1f69f656f2afc85ee42ccf3beb197c56c60acc07a82d0818d4a5af425b8b2e080bbdecf76815fadb966d08ed70706
6
+ metadata.gz: 0e57b1a386bf1d2ef566f385499e4daf7b14ee34c74295c6f3cba6a6b8fc75e95956005f33af86d4a407bc2e613a0130a2b9ffe4ceb9c115c5230143db9a62bb
7
+ data.tar.gz: eb2f8b9a873852919c5a8f6fa1f644a293f05cf62398028a37315053bf793fefc1297f956bf851fba3bf29dcef4b77c784e1d4068f352b341fd2cb0f336cdb4d
@@ -39,6 +39,8 @@ module Datory
39
39
  output_formatter.call(value: value)
40
40
  elsif [Date, Time, DateTime].include?(value.class)
41
41
  value.to_s
42
+ elsif ActiveSupport::Duration == value.class
43
+ value.iso8601
42
44
  else
43
45
  value
44
46
  end
@@ -21,6 +21,8 @@ module Datory
21
21
  output_option_helpers [
22
22
  Servactory::ToolKit::DynamicOptions::Format.use
23
23
  ]
24
+
25
+ predicate_methods_enabled false
24
26
  end
25
27
  end
26
28
  end
data/lib/datory/utils.rb CHANGED
@@ -5,13 +5,14 @@ module Datory
5
5
  module_function
6
6
 
7
7
  TRANSFORMATIONS = {
8
- Date => ->(value) { Date.parse(value) },
9
- Time => ->(value) { Time.parse(value) },
10
- DateTime => ->(value) { DateTime.parse(value) },
11
8
  Symbol => ->(value) { value.to_sym },
12
9
  String => ->(value) { value.to_s },
13
10
  Integer => ->(value) { value.to_i },
14
- Float => ->(value) { value.to_f }
11
+ Float => ->(value) { value.to_f },
12
+ Date => ->(value) { Date.parse(value) },
13
+ Time => ->(value) { Time.parse(value) },
14
+ DateTime => ->(value) { DateTime.parse(value) },
15
+ ActiveSupport::Duration => ->(value) { ActiveSupport::Duration.parse(value) }
15
16
  }.freeze
16
17
 
17
18
  private_constant :TRANSFORMATIONS
@@ -5,7 +5,7 @@ module Datory
5
5
  MAJOR = 1
6
6
  MINOR = 0
7
7
  PATCH = 0
8
- PRE = "rc5"
8
+ PRE = "rc7"
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc5
4
+ version: 1.0.0.rc7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Sokolov
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.5.0.rc5
53
+ version: 2.5.0.rc6
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 2.5.0.rc5
60
+ version: 2.5.0.rc6
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: zeitwerk
63
63
  requirement: !ruby/object:Gem::Requirement