iso8601-basic 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/iso8601/duration.rb +13 -1
- data/lib/iso8601/version.rb +1 -1
- 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: cbed125354afce1f4f269c650c3db7a8a7a43241
|
4
|
+
data.tar.gz: 717dc6614479def8c2cd35c8e500f587c07f677f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a01af67778a77412912f6db4860b1c0d1541a5e15d4afac1651d5d86602539afb8e63ce1e723c0f6a2caacaad617659bd2abc61e6d2737a66a4d9e9d4de62bd
|
7
|
+
data.tar.gz: adaf7389ef47fe092ead9ccdc4d2a5bcd749cc19feb6e23f4a696fadf802d68a07adafca1b8ed23862ce0b7752cd002ef483e63d6d4f26bf484d02328fd2d55b
|
data/lib/iso8601/duration.rb
CHANGED
@@ -64,7 +64,7 @@ class ISO8601::Duration
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def hash
|
67
|
-
[self.class,
|
67
|
+
[self.class, to_a].hash
|
68
68
|
end
|
69
69
|
|
70
70
|
def inspect
|
@@ -75,6 +75,14 @@ class ISO8601::Duration
|
|
75
75
|
iso8601
|
76
76
|
end
|
77
77
|
|
78
|
+
def as_json
|
79
|
+
iso8601
|
80
|
+
end
|
81
|
+
|
82
|
+
def to_json
|
83
|
+
"\"#{iso8601}\""
|
84
|
+
end
|
85
|
+
|
78
86
|
def format
|
79
87
|
singular = {
|
80
88
|
years: 'year',
|
@@ -107,6 +115,10 @@ class ISO8601::Duration
|
|
107
115
|
to_f.to_i
|
108
116
|
end
|
109
117
|
|
118
|
+
def to_a
|
119
|
+
to_h.to_a
|
120
|
+
end
|
121
|
+
|
110
122
|
def to_h
|
111
123
|
{ years: @years,
|
112
124
|
months: @months,
|
data/lib/iso8601/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iso8601-basic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Very basic implementation of the ISO8601 spec - http://en.wikipedia.org/wiki/ISO_8601
|
14
14
|
email: olly@ticketinghub.com
|