super_serialize 0.0.4 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 643b5a34abc544e4a27c77af7679a6243746dc4e
4
- data.tar.gz: 20bb2ef4df1ffa1bb82c32cf7274aeb3e82d507c
3
+ metadata.gz: ffb0fc6a6ee999a3eae3cc4c757e4514b0a890f4
4
+ data.tar.gz: 919cfc6f7ea3ddbb37618f6d1faa02c8ef46be80
5
5
  SHA512:
6
- metadata.gz: d6aff682824fd655df8108ef2d25c3ba2c5a6a3b06989721313f3cd2f2e227265c72f823a7a49219a98259feb2906598814944cc27ed53ae4a77058f6a6efd3b
7
- data.tar.gz: 9334bcde876cf0b1b2b097312edd10a11a04cbe76d8d22f5720b8f37cfe8e6cb72c404025e870c8d0aa59c4b63c1384437452e8e3b7b140297c73562a5bf3708
6
+ metadata.gz: eb0ebec6718656c3ca577eb7a38d3071a54bab5fb8eba66f84ef743db2065c78d76d84bd964526821bac6fa7873755e6ad5b7044c72c46359d9bc0137fdd9706
7
+ data.tar.gz: efb3b1c2af822078b80cf9f88d9e9e35b8eb7418d73507235f93f7787928687141518d001e1fc96fb4033df03bf76c106e90345208ad29239aefa70eb98ef12b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SuperSerialize
2
2
 
3
- A super, simple way to serialize anything from fixnums and floats to arrays and hashes.
3
+ A super, simple way to serialize anything from Fixnums and Floats to Arrays, Hashes, Times and Dates.
4
4
 
5
5
  ## Installation
6
6
 
@@ -85,6 +85,33 @@ Or install it yourself as:
85
85
  > sm.varied_attr_type.class
86
86
  => ActiveSupport::HashWithIndifferentAccess
87
87
 
88
+ > sm.varied_attr_type = "2014-12-06 12:00:00 -0500"
89
+ > sm.varied_attr_type
90
+ => 2014-12-06 12:00:00 -0500
91
+
92
+ > sm.varied_attr_type.class
93
+ => Time
94
+
95
+ > sm.varied_attr_type = Time.parse("2014-12-06 12:00:00 -0500")
96
+ > sm.varied_attr_type
97
+ => 2014-12-06 12:00:00 -0500
98
+
99
+ > sm.varied_attr_type.class
100
+ => Time
101
+
102
+ > sm.varied_attr_type = "2014-12-06"
103
+ > sm.varied_attr_type
104
+ => 2014-12-06 12:00:00 -0500
105
+
106
+ > sm.varied_attr_type.class
107
+ => Date
108
+
109
+ > sm.varied_attr_type = Date.parse("2014-12-06")
110
+ > sm.varied_attr_type
111
+ => 2014-12-06
112
+
113
+ > sm.varied_attr_type.class
114
+ => Date
88
115
 
89
116
  ## Contributing
90
117
 
@@ -1,3 +1,3 @@
1
1
  module SuperSerialize
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -59,6 +59,26 @@ module SuperSerialize
59
59
  # => {"key" => 'some value'}
60
60
  # > sm.varied_attr_type.class
61
61
  # => ActiveSupport::HashWithIndifferentAccess
62
+ # > sm.varied_attr_type = "2014-12-06 12:00:00 -0500"
63
+ # > sm.varied_attr_type
64
+ # => 2014-12-06 12:00:00 -0500
65
+ # > sm.varied_attr_type.class
66
+ # => Time
67
+ # > sm.varied_attr_type = Time.parse("2014-12-06 12:00:00 -0500")
68
+ # > sm.varied_attr_type
69
+ # => 2014-12-06 12:00:00 -0500
70
+ # > sm.varied_attr_type.class
71
+ # => Time
72
+ # > sm.varied_attr_type = "2014-12-06"
73
+ # > sm.varied_attr_type
74
+ # => 2014-12-06 12:00:00 -0500
75
+ # > sm.varied_attr_type.class
76
+ # => Date
77
+ # > sm.varied_attr_type = Date.parse("2014-12-06")
78
+ # > sm.varied_attr_type
79
+ # => 2014-12-06
80
+ # > sm.varied_attr_type.class
81
+ # => Date
62
82
 
63
83
  attr_names.each do |attr_name|
64
84
  unless column_names.include?(attr_name.to_s)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ricardo Quiñones