ripple-rest 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -5,4 +5,19 @@ ripple-rest gem
5
5
 
6
6
  This is a client that interacts with the Ripple network using the Ripple REST APIs.
7
7
 
8
- The documentation can be found at http://rubydoc.info/github/orzfly/ruby-ripple-rest/master/frames.
8
+ The documentation can be found at http://rubydoc.info/github/orzfly/ruby-ripple-rest/master/frames.
9
+
10
+ Example
11
+ -------
12
+
13
+ ```ruby
14
+ require 'ripple-rest'
15
+
16
+ RippleRest.setup "http://localhost:5990/"
17
+ acc = RippleRest::Account.new "r###########", "s###########"
18
+ p acc.payments.create("r###########", "1+XRP").submit
19
+ p acc.settings
20
+ p acc.trustlines
21
+ ```
22
+
23
+
@@ -76,7 +76,7 @@ class << RippleRest
76
76
 
77
77
  json = JSON.parse response.to_str rescue nil
78
78
  if json
79
- raise RippleRest::RippleRestError.new(json["message"], json) unless json["success"]
79
+ raise RippleRest::RippleRestError.new(json["message"] || json["error"] || json.to_json, json) unless json["success"]
80
80
  end
81
81
 
82
82
  if !response || response.code != 200
@@ -100,6 +100,11 @@ module RippleRest
100
100
  RETURN_SELF,
101
101
  lambda { |x| [true, false].include? x }
102
102
 
103
+ register :Float,
104
+ lambda { |x| x.to_f.to_s },
105
+ lambda { |x| x.to_f },
106
+ lambda { |x| x.is_a?(Numeric) }
107
+
103
108
  register :FloatString,
104
109
  lambda { |x| x.is_a?(BigDecimal) ? x.to_s("F") : BigDecimal.new(x.to_s).to_s("F") },
105
110
  lambda { |x| x.is_a?(BigDecimal) ? x : BigDecimal.new(x) },
@@ -13,7 +13,8 @@ module RippleRest
13
13
 
14
14
  account.require_secret
15
15
 
16
- hash = to_hash
16
+ hash = {}
17
+ hash["settings"] = to_hash
17
18
  hash["secret"] = account.secret
18
19
 
19
20
  RippleRest.post "v1/accounts/#{account.address}/settings", hash
@@ -1,3 +1,3 @@
1
1
  module RippleRest
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripple-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-28 00:00:00.000000000 Z
12
+ date: 2014-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -58,7 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  segments:
60
60
  - 0
61
- hash: -728632721
61
+ hash: 111114351
62
62
  required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements: