fino 1.11.1 → 1.11.2
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/lib/fino/settings/numeric.rb +47 -8
- data/lib/fino/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d12f841f4cb292abb0cef952f0d45baa88fa8ca756c2745d98f15c3f15682e9
|
|
4
|
+
data.tar.gz: 16960d606ab7089caeb2c4274d4247d153cf1d7cbbd7a4b6f6addd5d73d14548
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bde25feb4018e547f42f6ee3a0ca6df453bb678fbae110fab317f46df0fa758f05f357e74e3c05251594e4a1bb324ae123e2bf053b631e3684137a64f029328
|
|
7
|
+
data.tar.gz: 4b8178706b16045053ac768d3845caf30bcb877fcc48cef2ffd30ffa84310e7033fb194c9a9327dcd1e7e287de53d04f72c5627801fa4958eeb0c1427416fd60
|
|
@@ -47,17 +47,56 @@ module Fino::Settings::Numeric
|
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
class Minutes < Generic
|
|
51
|
+
include Time
|
|
52
|
+
|
|
53
|
+
def initialize = super("Minutes", "min")
|
|
54
|
+
|
|
55
|
+
def base_factor
|
|
56
|
+
60
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class Hours < Generic
|
|
61
|
+
include Time
|
|
62
|
+
|
|
63
|
+
def initialize = super("Hours", "hour")
|
|
64
|
+
|
|
65
|
+
def base_factor
|
|
66
|
+
3600
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
class Days < Generic
|
|
71
|
+
include Time
|
|
72
|
+
|
|
73
|
+
def initialize = super("Days", "day")
|
|
74
|
+
|
|
75
|
+
def base_factor
|
|
76
|
+
86_400
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
UNITS = {
|
|
81
|
+
"ms" => Milliseconds,
|
|
82
|
+
"milliseconds" => Milliseconds,
|
|
83
|
+
"sec" => Seconds,
|
|
84
|
+
"seconds" => Seconds,
|
|
85
|
+
"min" => Minutes,
|
|
86
|
+
"minutes" => Minutes,
|
|
87
|
+
"hour" => Hours,
|
|
88
|
+
"hours" => Hours,
|
|
89
|
+
"day" => Days,
|
|
90
|
+
"days" => Days
|
|
91
|
+
}.freeze
|
|
92
|
+
|
|
50
93
|
module_function
|
|
51
94
|
|
|
52
95
|
def for(identifier)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Seconds.new
|
|
58
|
-
else
|
|
59
|
-
Generic.new(identifier.to_s.capitalize)
|
|
60
|
-
end
|
|
96
|
+
klass = UNITS[identifier.to_s]
|
|
97
|
+
return klass.new if klass
|
|
98
|
+
|
|
99
|
+
Generic.new(identifier.to_s.capitalize)
|
|
61
100
|
end
|
|
62
101
|
end
|
|
63
102
|
|
data/lib/fino/version.rb
CHANGED