js_obj 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -15
- data/demo.rb +10 -15
- data/lib/js_obj/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc7fad58fc276beb3b52ad93338988801ffaf90b
|
4
|
+
data.tar.gz: 7617cc15f87aced2cdab0c501dd3f707cece9b48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a9e8894697f228d4f1b5235dc6072e659e09fa14ae7ce2b659cae427a79de36f27ae8e6b411bd5a54629017ceffd6f62689d953ac979bb35647b5bc1030d657
|
7
|
+
data.tar.gz: 0f3989066af46a68d463c43e3dda825fd6e89e533ff0d211fda4a7dd5d6547654688a37f18531c6120f8689c25e40aeff5336a1358e6daf9d293991b8ac2f4b5
|
data/README.md
CHANGED
@@ -25,32 +25,27 @@ require 'js_obj'
|
|
25
25
|
|
26
26
|
user = {
|
27
27
|
id: 1001,
|
28
|
+
name: 'user1',
|
28
29
|
position: {
|
29
30
|
x: 10.5,
|
30
31
|
y: -1.2
|
31
32
|
}
|
32
33
|
}
|
33
34
|
|
34
|
-
# Get
|
35
|
+
# Get
|
36
|
+
puts user.id #=> 1001
|
37
|
+
puts user.position.x #=> 10.5
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
puts user.
|
39
|
-
#=> 10.5
|
40
|
-
|
41
|
-
# Add property
|
42
|
-
|
43
|
-
user.name = "user1"
|
44
|
-
puts user.name
|
45
|
-
#=> user1
|
39
|
+
# Set
|
40
|
+
user.name = "Jason"
|
41
|
+
puts user.name #=> "Jason"
|
46
42
|
|
43
|
+
# Add
|
47
44
|
user.position.z = 9.8
|
48
|
-
puts user.position.z
|
49
|
-
#=> 9.8
|
45
|
+
puts user.position.z #=> 9.8
|
50
46
|
|
51
47
|
# Usual way
|
52
|
-
puts user[:id]
|
53
|
-
#=> 1001
|
48
|
+
puts user[:id] #=> 1001
|
54
49
|
|
55
50
|
```
|
56
51
|
|
data/demo.rb
CHANGED
@@ -2,29 +2,24 @@ require 'js_obj'
|
|
2
2
|
|
3
3
|
user = {
|
4
4
|
id: 1001,
|
5
|
+
name: 'user1',
|
5
6
|
position: {
|
6
7
|
x: 10.5,
|
7
8
|
y: -1.2
|
8
9
|
}
|
9
10
|
}
|
10
11
|
|
11
|
-
# Get
|
12
|
+
# Get
|
13
|
+
puts user.id #=> 1001
|
14
|
+
puts user.position.x #=> 10.5
|
12
15
|
|
13
|
-
|
14
|
-
|
15
|
-
puts user.
|
16
|
-
#=> 10.5
|
17
|
-
|
18
|
-
# Add property
|
19
|
-
|
20
|
-
user.name = "user1"
|
21
|
-
puts user.name
|
22
|
-
#=> user1
|
16
|
+
# Set
|
17
|
+
user.name = "Jason"
|
18
|
+
puts user.name #=> "Jason"
|
23
19
|
|
20
|
+
# Add
|
24
21
|
user.position.z = 9.8
|
25
|
-
puts user.position.z
|
26
|
-
#=> 9.8
|
22
|
+
puts user.position.z #=> 9.8
|
27
23
|
|
28
24
|
# Usual way
|
29
|
-
puts user[:id]
|
30
|
-
#=> 1001
|
25
|
+
puts user[:id] #=> 1001
|
data/lib/js_obj/version.rb
CHANGED