js_obj 0.1.0 → 1.0.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -1
  3. data/demo.rb +27 -0
  4. data/lib/js_obj/version.rb +1 -1
  5. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61f3ea939d2e27a0ed476d5a51f668c2092acdb5
4
- data.tar.gz: 927fe66c9f49ed7bd81f90affbe14b7496062d70
3
+ metadata.gz: 3e17eadaf01fe054057f8aad414905cf72ca2815
4
+ data.tar.gz: 47ad4a0930688e8f67be7cebb129591610f91d59
5
5
  SHA512:
6
- metadata.gz: 51d15e250a94d3846575ffccf604401989db4baaf0104457939faa6d459cbabfa02c644d818227b366a670bb6360452b075886584df24e480967c63faca6d5f3
7
- data.tar.gz: bdd42ca90a51642c494e5cf7d02bf7b22b9955a0a4dff8580987ec52ee917bdba985aab7effc4689d52abc6ae6582480b312e797ab4283959e31294c3145cd42
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
- TODO: Write usage instructions here
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
@@ -1,3 +1,3 @@
1
1
  module JsObj
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
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: 0.1.0
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