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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cedeab4786ea677611d4ae3438f7b879e5f840b
4
- data.tar.gz: 470d1affea932d51f6353c19296d5de59192b81f
3
+ metadata.gz: cbed125354afce1f4f269c650c3db7a8a7a43241
4
+ data.tar.gz: 717dc6614479def8c2cd35c8e500f587c07f677f
5
5
  SHA512:
6
- metadata.gz: c80808fc31b2a0fc58d989261f74765ad9de385667af0d8c73856ae4e65ec8eb5f34bd0ea9d67bc53668d7a7a2dda23e279aca8ba4003c08d7d2931004712eea
7
- data.tar.gz: 16897a017aae22dc408195fa8ec9ea56f44889bb7cf77087a64d4ca3e562d5ffe8e58dca09b9bdbb7bcb1b67bcd027ba237541c6886d4a2c326923df45730c58
6
+ metadata.gz: 8a01af67778a77412912f6db4860b1c0d1541a5e15d4afac1651d5d86602539afb8e63ce1e723c0f6a2caacaad617659bd2abc61e6d2737a66a4d9e9d4de62bd
7
+ data.tar.gz: adaf7389ef47fe092ead9ccdc4d2a5bcd749cc19feb6e23f4a696fadf802d68a07adafca1b8ed23862ce0b7752cd002ef483e63d6d4f26bf484d02328fd2d55b
@@ -64,7 +64,7 @@ class ISO8601::Duration
64
64
  end
65
65
 
66
66
  def hash
67
- [self.class, to_h.to_a].hash
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,
@@ -1,3 +1,3 @@
1
1
  module ISO8601
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
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.0
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-17 00:00:00.000000000 Z
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