openassets-ruby 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openassets/protocol/asset_definition.rb +17 -0
- data/lib/openassets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c04f0268f5e83b4ee4160e4e77f009ae83c7f718
|
4
|
+
data.tar.gz: 7424529ab78442b26a18498b92e7038f49d7c41d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8355b3c57888d6f87b552b686b3a05e598a79cc4cd7d6a6cb1e71e4e7c01c6f5edabc7ed8c7521f289b9c4255cc7f2e954f52e388391ba656f9d3640e1e8bf37
|
7
|
+
data.tar.gz: 5cc51df88f80bf2b5b3abda6b01136648ec33f9a0db17b06f249d3547f81b6a6786ed09884612c9a7803a58034817511c6131ce3872ba4ce0e258f736ff83940
|
@@ -20,6 +20,12 @@ module OpenAssets
|
|
20
20
|
attr_accessor :image_url
|
21
21
|
attr_accessor :version
|
22
22
|
|
23
|
+
def initialize
|
24
|
+
@asset_ids = []
|
25
|
+
@version = '1.0'
|
26
|
+
@divisibility = 0
|
27
|
+
end
|
28
|
+
|
23
29
|
# Parse the JSON obtained from the json String, and create a AssetDefinition object.
|
24
30
|
# @param[String]
|
25
31
|
def self.parse_json(json)
|
@@ -47,6 +53,7 @@ module OpenAssets
|
|
47
53
|
begin
|
48
54
|
parse_json(RestClient.get url, :accept => :json)
|
49
55
|
rescue => e
|
56
|
+
puts e
|
50
57
|
nil
|
51
58
|
end
|
52
59
|
end
|
@@ -56,6 +63,16 @@ module OpenAssets
|
|
56
63
|
asset_ids.include?(asset_id)
|
57
64
|
end
|
58
65
|
|
66
|
+
# Convert Asset Definition to json format.
|
67
|
+
def to_json
|
68
|
+
hash = {}
|
69
|
+
self.instance_variables.each do |var|
|
70
|
+
key = var.to_s
|
71
|
+
key.slice!(0) if key.start_with?('@')
|
72
|
+
hash[key] = self.instance_variable_get var
|
73
|
+
end
|
74
|
+
hash.to_json
|
75
|
+
end
|
59
76
|
end
|
60
77
|
|
61
78
|
end
|
data/lib/openassets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openassets-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitcoin-ruby
|