ice_cube 0.3.4 → 0.3.5
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.
- data/lib/ice_cube/schedule.rb +8 -4
- data/lib/ice_cube/version.rb +1 -1
- metadata +3 -3
data/lib/ice_cube/schedule.rb
CHANGED
@@ -15,17 +15,21 @@ module IceCube
|
|
15
15
|
# Convert the schedule to a hash, reverse of Schedule.from_hash
|
16
16
|
def to_hash
|
17
17
|
hash = Hash.new
|
18
|
-
hash[:start_date] =
|
18
|
+
hash[:start_date] = @start_date
|
19
19
|
hash[:rrules] = @rrule_occurrence_heads.map { |rr| rr.rule.to_hash }
|
20
20
|
hash[:exrules] = @exrule_occurrence_heads.map { |ex| ex.rule.to_hash }
|
21
|
-
hash[:rdates] = @rdates
|
22
|
-
hash[:exdates] = @exdates
|
21
|
+
hash[:rdates] = @rdates
|
22
|
+
hash[:exdates] = @exdates
|
23
23
|
hash
|
24
24
|
end
|
25
25
|
|
26
26
|
# Convert the schedule to yaml, reverse of Schedule.from_yaml
|
27
27
|
def to_yaml
|
28
|
-
to_hash
|
28
|
+
hash = to_hash
|
29
|
+
hash[:start_date] = TimeUtil.serializable_time(hash[:start_date])
|
30
|
+
hash[:rdates] = hash[:rdates].map { |t| TimeUtil.serializable_time(t) }
|
31
|
+
hash[:exdates] = hash[:exdates].map { |t| TimeUtil.serializable_time(t) }
|
32
|
+
hash.to_yaml
|
29
33
|
end
|
30
34
|
|
31
35
|
# Create a schedule from a hash created by instance.to_hash
|
data/lib/ice_cube/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 5
|
9
|
+
version: 0.3.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- John Crepezzi
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-30 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|