monacoin_client 0.0.5 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8a9ddcc7a7ecf8df68b35e342680767eb19a570
4
- data.tar.gz: 83d9dee0b3fcbe302c7f4620244b03b9ad33dc2e
3
+ metadata.gz: c0830af41fa36a2ca5caefe43f81a0bcb3644687
4
+ data.tar.gz: c5110ffddce241963e75b436738d4c72203d22f2
5
5
  SHA512:
6
- metadata.gz: 154acf902025db05cb78548fe07994e66aa49475c6c012aaf6ded28d5440c34a2768e9897e670e986fefc96a4fe9f820e444b03bbcb1ef47429ee94752869766
7
- data.tar.gz: 2a4302c914541fc60b1e50f5ee7a36f17ce115b3b30dea83599d25e3bd229c9b93e75807a48cb5e227ba1adeb976cf8c4cd073e618eb7946b66070441ddad207
6
+ metadata.gz: f4c6eb4db60b161321355050f00419a1a3454dfb7e92f9ffdfda1574f4308823b97401ae7f1ef87d3be48a38a708ad4ac5eea086b2f53e877c47038ddd7365cd
7
+ data.tar.gz: 9d421ea91f8a1bf0dbc515fa5ca650e6fc3a81d7c951f2a7f2b33e33ccafca26e086432523382946cf7f0b40c4c563c464bb99b0f95e44f2f11b6cda1ca0facc
data/README.md CHANGED
@@ -30,6 +30,14 @@ lt = MonacoinRPC.new('http://user:password@127.0.0.1:9332')
30
30
  p lt.getbalance # this outputs the balance
31
31
  ```
32
32
 
33
+ Example for Ticker from etwings
34
+
35
+ ```
36
+ require 'monacoin_client'
37
+
38
+ p MonacoinTickers::Etwings.ticker
39
+ ```
40
+
33
41
  ## Contributing
34
42
 
35
43
  1. Fork it
@@ -0,0 +1,9 @@
1
+ module MonacoinTickers
2
+ # Priceticker on etwings
3
+ module Etwings
4
+ def ticker
5
+ json = MonacoinTickers::getJsonObject("https://exchange.etwings.com/api/1/ticker/mona_jpy")
6
+ end
7
+ module_function :ticker
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ require 'net/http'
2
+ require 'uri'
3
+ require 'json'
4
+ require 'openssl'
5
+
6
+ # included pricetickers
7
+ require_relative 'monacoin_tickers/etwings'
8
+
9
+ # This module contains the price tickers
10
+ module MonacoinTickers
11
+ def getJsonObject(url)
12
+ uri = URI.parse(url)
13
+ http = Net::HTTP.new(uri.host, uri.port)
14
+ http.use_ssl = true
15
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
16
+ request = Net::HTTP::Get.new(uri.request_uri)
17
+ response = http.request(request)
18
+ resp = JSON.parse(response.body, { symbolize_names: true})
19
+ end
20
+
21
+ module_function :getJsonObject
22
+ end
@@ -1,3 +1,3 @@
1
1
  module MonacoinClient
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'monacoin_client/version'
2
2
  require 'monacoin_client/monacoin_rpc'
3
+ require 'monacoin_client/monacoin_tickers'
3
4
 
4
5
  module MonacoinClient
5
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monacoin_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuma Wakimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -53,6 +53,8 @@ files:
53
53
  - cert_file
54
54
  - lib/monacoin_client.rb
55
55
  - lib/monacoin_client/monacoin_rpc.rb
56
+ - lib/monacoin_client/monacoin_tickers.rb
57
+ - lib/monacoin_client/monacoin_tickers/etwings.rb
56
58
  - lib/monacoin_client/version.rb
57
59
  - monacoin_client.gemspec
58
60
  homepage: https://github.com/yuma300/monacoin_client
@@ -75,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
77
  version: '0'
76
78
  requirements: []
77
79
  rubyforge_project:
78
- rubygems_version: 2.2.2
80
+ rubygems_version: 2.2.0
79
81
  signing_key:
80
82
  specification_version: 4
81
83
  summary: This gem provides monacoin client