scoppie 0.0.1 → 0.0.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/scope.rb +1 -0
- data/lib/scope_methods.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48e4573a157b2efd5632f9ca75c7ff3f3fa537a5
|
4
|
+
data.tar.gz: 54ec75f07ceb38f0b0c6c96d457c071126741766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a216c7a57b097db0656994f03bd358cd155531b4c8f77168ea467abb1916ad93658a6d300b577a7f2de2050dfaec89751afa220d1ab16d3090e03e3cecf5fe42
|
7
|
+
data.tar.gz: 68bbd28e99288614fce22ad8007070940c4e2923937db2272400e0cb81c8e083f2c080f7265e6541c291c7a1a1ed25e07774786b7c701f95df5a142c415a3a8e
|
data/lib/scope.rb
CHANGED
data/lib/scope_methods.rb
CHANGED
@@ -21,6 +21,8 @@ module ScopeMethods
|
|
21
21
|
valid_month?(month(scope)) and valid_year?(year(scope))
|
22
22
|
end
|
23
23
|
|
24
|
+
|
25
|
+
|
24
26
|
def year scope
|
25
27
|
scope[0..3].to_i
|
26
28
|
end
|
@@ -64,6 +66,10 @@ module ScopeMethods
|
|
64
66
|
Scope.month @value
|
65
67
|
end
|
66
68
|
|
69
|
+
def month_to_s
|
70
|
+
month < 10 ? "0#{month.to_i}" : "#{month.to_i}"
|
71
|
+
end
|
72
|
+
|
67
73
|
def prior
|
68
74
|
date = Scope.scope_to_date(@value).prev_month
|
69
75
|
Scope.date_to_scope date
|
@@ -85,6 +91,11 @@ module ScopeMethods
|
|
85
91
|
def <=>(other)
|
86
92
|
to_date <=> other.to_date
|
87
93
|
end
|
94
|
+
|
95
|
+
private
|
96
|
+
def get_short_value
|
97
|
+
"#{year - 2000}#{month_to_s}"
|
98
|
+
end
|
88
99
|
end
|
89
100
|
|
90
101
|
def self.included receiver
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scoppie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gedean Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Scope handler
|
14
14
|
email: gedean.dias@gmail.com
|