ar_to_hash 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -2
- data/lib/ar_to_hash/extensions.rb +1 -1
- data/lib/ar_to_hash/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: 7f16466a2a020a9090438523dd93832694c6e64d
|
4
|
+
data.tar.gz: 080af9039367d04eb37f9a6d1056cbb4b9f410bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5325ce84d51745b1eb744180d1db19762c7541813e47bf9874e8279fab1ab25f6e2d36b8bbad7b8e00b78ec745c726656107ac7efc4c3a8dfde29e5849d6191
|
7
|
+
data.tar.gz: 9aeea9f1fbf99a793ae0d5cc58dbb733a50488edf705254c72129ce0ecea3a3fa67f749555190403d8372c813786c93608f56109b0b2f8b36e8065c284671ccb
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ArToHash
|
2
2
|
|
3
|
-
|
3
|
+
Add `to_hash` method to ActiveRecord::Base.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,41 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
### Normal
|
22
|
+
|
23
|
+
```rb
|
24
|
+
User.first.tapp
|
25
|
+
----------
|
26
|
+
#<User:0x007f81d11e2760> {
|
27
|
+
:id => 1,
|
28
|
+
:created_at => Mon, 03 Feb 2014 15:21:37 JST +09:00,
|
29
|
+
:updated_at => Thu, 01 May 2014 16:02:39 JST +09:00,
|
30
|
+
}
|
31
|
+
----------
|
32
|
+
|
33
|
+
User.first.class.name
|
34
|
+
----------
|
35
|
+
=> "User"
|
36
|
+
----------
|
37
|
+
```
|
38
|
+
|
39
|
+
### to_hash
|
40
|
+
|
41
|
+
```rb
|
42
|
+
User.first.to_hash.tapp
|
43
|
+
----------
|
44
|
+
{
|
45
|
+
"id" => 1,
|
46
|
+
"created_at" => "2014-02-03T15:21:37.442+09:00",
|
47
|
+
"updated_at" => "2014-05-01T16:02:39.670+09:00",
|
48
|
+
}
|
49
|
+
----------
|
50
|
+
|
51
|
+
User.first.to_hash.class.name
|
52
|
+
----------
|
53
|
+
=> "Hash"
|
54
|
+
----------
|
55
|
+
```
|
22
56
|
|
23
57
|
## Contributing
|
24
58
|
|
data/lib/ar_to_hash/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_to_hash
|
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
|
- shu0115
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|