From 0df35acdefd5bfc82766ad7d30b9f9459dfdfb61 Mon Sep 17 00:00:00 2001 From: Ivan Raszl Date: Tue, 7 Mar 2023 19:56:49 +0800 Subject: [PATCH 1/2] Add basic instructions Add very basic example of how to get the the most commonly requested data: Bitcoin price expressed in USD. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bdd3b9..b419143 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,13 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here +Example to get the current USD price: +```require 'coingecko_ruby' +client = CoingeckoRuby::Client.new +@btc_price = client.price('bitcoin')["bitcoin"]["usd"].to_f +``` + +TODO: Write full usage instructions here ## Development From da17110cb8eb520f762b42e8455f69bd0881bce4 Mon Sep 17 00:00:00 2001 From: Ivan Raszl Date: Tue, 7 Mar 2023 19:57:24 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b419143..4d65928 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ Or install it yourself as: ## Usage Example to get the current USD price: -```require 'coingecko_ruby' +``` +require 'coingecko_ruby' client = CoingeckoRuby::Client.new @btc_price = client.price('bitcoin')["bitcoin"]["usd"].to_f ```