csv_json_converter 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: f4a861d0f37952316e996ed45a1838727f8639cbeac64b393b6f0f10b6444822
4
- data.tar.gz: 712b4ac2af69d0e11441338e1ab190e2d93f0169ba8d21937c1dce41d1618c85
3
+ metadata.gz: f1f3376d08cdd35e377a8948b5557767c12ecaa6ebb016b211e12d8c13836d8d
4
+ data.tar.gz: 1f48a73d83e9c365b24ea62f640a9b31690c25ed7aa6e7c8e9d01f9f72992031
5
5
  SHA512:
6
- metadata.gz: 668f30cfdfe949fdc2c4f6998428d9da52020ea5175682b7ef958c9f80c0f3cb61d1864b4a9a4d9df2d7b642e306b4bdb433632cad8815747d32545a0d76a748
7
- data.tar.gz: 9ea7c0e6f7203587a295201f2871e918b8f40395eba99a2958be53267ec5055dc271d97892adf17fcd97912d863c67fa1768e77f44665c2ae1eaec873173c1f3
6
+ metadata.gz: f78b16b10cbc8e594395402d2ce6d3cd8f1041f2e2a689664a644defc62ff4ab8ef7045d82eccd23bac63571ab45b3fc3cbb709d5efebf0a1d18738dde061467
7
+ data.tar.gz: 6938447a517037a4d10fc481f8073efadd1a2cb9aa971207b9edc349dd94c24faf6cf38ae0e1d9dca3bcaf2f5acf0f3b3f88b2a589436a61d522a52ccee00db9
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <a name="readme-top"></a>
4
4
  # :green_book: Table of Contents
5
- [![csv_json_ - converter](https://img.shields.io/badge/json__or__ruby__to__-csv-2ea44f)](https://rubygems.org/gems/csv_json_converter)
5
+ [![csv_json_ - converter](https://img.shields.io/badge/csv_json_convert_-csv-2ea44f)](https://rubygems.org/gems/csv_json_converter)
6
6
  - [:green_book: Table of Contents](#-table-of-contents)
7
7
  - [:book: csv\_json\_converter ](#-csv_json_converter-)
8
8
  - [Installation ](#installation-)
@@ -27,7 +27,7 @@ gem install csv_json_converter
27
27
  ```
28
28
  ### Usage
29
29
  `require` this gem on the top of your ruby code.
30
- #### Covert csv_to_json
30
+ ### Covert csv to json
31
31
  If you want to convert `csv string`, to json you can use `to_json` method from `CsvJsonConverter`. Let's see how:-
32
32
 
33
33
  <i>For example </i>
@@ -52,7 +52,30 @@ If you want to convert `csv string`, to json you can use `to_json` method from `
52
52
  "hex": "jz40cbafbec8d6f92e93d22ea6ef5b"
53
53
  }
54
54
  ```
55
+ ### Covert json to csv
56
+ If you want to convert `json object`, to json you can use `to_csv` method from `CsvJsonConverter`. Let's see how:-
55
57
 
58
+ <i>For example </i>
59
+ ```ruby
60
+
61
+ require 'csv_json_converter'
62
+
63
+ data_json={ "file": "test18.csv",
64
+ "text": "CMkABfAGXvmSFV",
65
+ "number": 9892576,
66
+ "hex": "jz40cbafbec8d6f92e93d22ea6ef5b"
67
+ }
68
+
69
+ csv_data = CsvJsonCoverter.to_csv(data_json)
70
+
71
+ print csv_data
72
+
73
+ ```
74
+
75
+ **The output looks like below**
76
+ ```
77
+ "file,text,number,hex\ntest18.csv,CMkABfAGXvmSFV,9892576,jz40cbafbec8d6f92e93d22ea6ef5b
78
+ ```
56
79
  ## :busts_in_silhouette: Authors <a name="authors"></a>
57
80
  :bust_in_silhouette: Pablo Zambrano
58
81
  - GitHub: [@alexoid1](https://github.com/melashu)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CsvJsonConverter
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_json_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - alexoid1
@@ -27,11 +27,12 @@ files:
27
27
  - lib/csv_json_converter.rb
28
28
  - lib/csv_json_converter/version.rb
29
29
  - sig/csv_json_converter.rbs
30
- homepage: https://github.com/Alexoid1/csv_json_converter
30
+ homepage: https://rubygems.org/gems/csv_json_converter
31
31
  licenses:
32
32
  - MIT
33
33
  metadata:
34
- homepage_uri: https://github.com/Alexoid1/csv_json_converter
34
+ homepage_uri: https://rubygems.org/gems/csv_json_converter
35
+ documentation_uri: https://github.com/Alexoid1/csv_json_converter
35
36
  source_code_uri: https://github.com/Alexoid1/csv_json_converter
36
37
  post_install_message:
37
38
  rdoc_options: []