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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a49e262b1967bf882e9d0784792cd8d9094dd7e1
4
- data.tar.gz: c704857446ea7bdb6c6616f182cefca019d8c010
3
+ metadata.gz: c04f0268f5e83b4ee4160e4e77f009ae83c7f718
4
+ data.tar.gz: 7424529ab78442b26a18498b92e7038f49d7c41d
5
5
  SHA512:
6
- metadata.gz: 30e2d67a221926202a89b8830bab16400b3a0d44e1f6d8cd9cc663fb9e5e2d81cc366e3929df5a09ed66506952b35d91cc038ba9037ad5dd6cf4a2832aa9a313
7
- data.tar.gz: 9cb5791d2b42bb7a805ce48a4dc36ded106fcd9939bbc9275de9259e399459bbd7e1f85645522c9bb807e52fa8cab7665f147b9fbbc390bd2f50e2f17a7e2587
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
@@ -1,3 +1,3 @@
1
1
  module OpenAssets
2
- VERSION = '0.2.6'
2
+ VERSION = '0.2.7'
3
3
  end
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.6
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: 2015-12-23 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitcoin-ruby