js_obj 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -1
- data/demo.rb +27 -0
- data/lib/js_obj/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e17eadaf01fe054057f8aad414905cf72ca2815
|
4
|
+
data.tar.gz: 47ad4a0930688e8f67be7cebb129591610f91d59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d5187cba0dedad566059f5904b647f0c60b350712e3edd6ee4ea40bccee273cfcad4c604f964159d8ad5b55d8f61e30b1f547f8590eeccf47ba9376c59da6aa
|
7
|
+
data.tar.gz: 975705ea235fecb268e687079b67d198513ba410d45d8b1a30058475f21575372a907dfc55ca31f22968d695a64489dba07bbfd9af122f6340ce5b9a368f2d8e
|
data/README.md
CHANGED
@@ -22,7 +22,35 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
```ruby
|
26
|
+
require 'js_obj'
|
27
|
+
|
28
|
+
user = {
|
29
|
+
id: 1001,
|
30
|
+
position: {
|
31
|
+
x: 10.5,
|
32
|
+
y: -1.2
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
# Get property
|
37
|
+
puts user.id
|
38
|
+
#=> 1001
|
39
|
+
|
40
|
+
# Get property
|
41
|
+
puts user.position.x
|
42
|
+
#=> 10.5
|
43
|
+
|
44
|
+
# Add property
|
45
|
+
user.name = "user1"
|
46
|
+
puts user.name
|
47
|
+
#=> user1
|
48
|
+
|
49
|
+
# Add property
|
50
|
+
user.position.z = 9.8
|
51
|
+
puts user.position.z
|
52
|
+
#=> 9.8
|
53
|
+
```
|
26
54
|
|
27
55
|
## Development
|
28
56
|
|
data/demo.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'js_obj'
|
2
|
+
|
3
|
+
user = {
|
4
|
+
id: 1001,
|
5
|
+
position: {
|
6
|
+
x: 10.5,
|
7
|
+
y: -1.2
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
# Get property
|
12
|
+
puts user.id
|
13
|
+
#=> 1001
|
14
|
+
|
15
|
+
# Get property
|
16
|
+
puts user.position.x
|
17
|
+
#=> 10.5
|
18
|
+
|
19
|
+
# Add property
|
20
|
+
user.name = "user1"
|
21
|
+
puts user.name
|
22
|
+
#=> user1
|
23
|
+
|
24
|
+
# Add property
|
25
|
+
user.position.z = 9.8
|
26
|
+
puts user.position.z
|
27
|
+
#=> 9.8
|
data/lib/js_obj/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: js_obj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Ota
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- Rakefile
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
|
+
- demo.rb
|
72
73
|
- js_obj.gemspec
|
73
74
|
- lib/js_obj.rb
|
74
75
|
- lib/js_obj/version.rb
|