geo_ppp 0.1.4 → 0.1.5

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -14
  3. data/lib/geo_ppp/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2597eeb4b44aea702a71741374dff570adf042a3a7f3887e51fc2cd38decb2b7
4
- data.tar.gz: cccd7bcc8a6b0d94e1e57eb42ac537c21ff4d832161e99bc84ae66a927b59f66
3
+ metadata.gz: f73f28fd7637f9db3d180ca821318fb08ee7c77702c02c8cf644ffd16032a3a5
4
+ data.tar.gz: 7a0f670a6f636f22c49973ffc3bfcfde26c355556f1d9a6eb1c8e6352f814e7e
5
5
  SHA512:
6
- metadata.gz: '00558f17d0aacc6bb4c5ba2296a76e4018ae4a941f9ed106ed2bdac5ab295e40773e9144df9be8b8afd9c8a07059053959603983489a608c11326462a54536b0'
7
- data.tar.gz: f86da527a35b8cc53f80a2e44bb4bacf1a3602cb63e818c0bffd3a641ed0632803b161ea534a0b0364cab71c6ddd155610a979592be3bc4c2bbb1dabd51bdcb9
6
+ metadata.gz: 8aa4808a8265794ee8edc5d5302c9644b822c55c6f11a4e57e9118624fb00767627fa7569c16f52abf60c53b08915d3b4811105e35dd69602338d61b39b18851
7
+ data.tar.gz: 23d6871087aeb198f5d534914c06a471620f4be23fd8f241313abc521c818863dd8fa7d4699fe036c3b6e1493fae2c2c03781a3438a0092e78c0f9ac11a25acc
data/README.md CHANGED
@@ -1,34 +1,52 @@
1
- # GeoPpp
1
+ # Geo Purchasing Power Parity
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/geo_ppp`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Sell your digital products at purchasing power parity for based on users country. Not everyone is able to pay for the default pricing of the high income world. Cup of Coffee in Colombia or Indonesia cost less than USA or Australia, apply same principal to your digital products and get more customers. This package is inspired by `purchasing-power-parity` npm and uses their API.
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
7
+ Add this line to your application's Gemfile
8
+ ```bash
9
+ gem 'geo_ppp'
10
+ ```
12
11
 
12
+ and run bundle
13
13
  ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
14
+ bundle install
15
15
  ```
16
16
 
17
17
  If bundler is not being used to manage dependencies, install the gem by executing:
18
18
 
19
19
  ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
20
+ gem install geo_pp
21
21
  ```
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ```ruby
26
+ GeoPPPFetcher.fetch
27
+ ```
28
+
29
+ will return a following json structure, you could use ```pppConversionFactor``` to convert it price based on user's geographic location
26
30
 
27
- ## Development
31
+ ```ruby
32
+ {"countryCodeIsoAlpha2":"LK","countryCodeIsoAlpha3":"LKA","currenciesCountry":{"LKR":{"symbol":"Rs රු","name":"Sri Lankan rupee"}},"currencyMain":{"exchangeRate":300.701498,"name":"USD","symbol":"$"},"ppp":10040.0,"pppConversionFactor":0.33}
33
+ ```
28
34
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
35
+ ```ruby
36
+ def index
37
+ original_price = 79.99
38
+
39
+ begin
40
+ response = GeoPPPFetcher.fetch
41
+ discounted_price = original_price * response['pppConversionFactor']
42
+ data = { original_price: original_price, discounted_price: discounted_price }
43
+ render json: { success: true, data: data }
44
+ rescue StandardError => e
45
+ render json: { success: false, error: e.message }, status: :unprocessable_entity
46
+ end
47
+ end
48
+ ```
30
49
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
50
 
33
51
  ## Contributing
34
52
 
@@ -40,4 +58,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
58
 
41
59
  ## Code of Conduct
42
60
 
43
- Everyone interacting in the GeoPpp project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/geo_ppp/blob/master/CODE_OF_CONDUCT.md).
61
+ Everyone interacting in the geo_ppp project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/geo_ppp/blob/master/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoPpp
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_ppp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - waruna