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 +16 -1
- data/lib/ripple-rest.rb +1 -1
- data/lib/ripple-rest/rest-object.rb +5 -0
- data/lib/ripple-rest/schemas.rb +2 -1
- data/lib/ripple-rest/version.rb +1 -1
- metadata +3 -3
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
|
+
|
data/lib/ripple-rest.rb
CHANGED
@@ -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) },
|
data/lib/ripple-rest/schemas.rb
CHANGED
data/lib/ripple-rest/version.rb
CHANGED
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.
|
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-
|
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:
|
61
|
+
hash: 111114351
|
62
62
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|