chain-sdk 1.0.0 → 1.0.1

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: 0adc2f40d926eedab0166512b49ce1f40a35a648
4
- data.tar.gz: 9ed8dd34df9a052daa55cad7e681d1171e67f830
3
+ metadata.gz: f5af937202113aa24173fde927a2695a87cec5a2
4
+ data.tar.gz: 39ba00e11865ea11a2cece9588a2b3c13425c5b2
5
5
  SHA512:
6
- metadata.gz: a1b7b5c4d22c8af78241609040b3ccbbe8e56c83674bcd430b4e9030a89e035dbc93cf4e4c03ce3977b9cd69bcfa7f8003caf11c2f9c034ab5699470cb4be55a
7
- data.tar.gz: 3aff727fef8f250337dc2d600297ec0cd4014d58350e34b7831e229eda425c32e7f63ec22fc3953a808b3f0223a1c9afec192e662b6a3ec5b87481c7d08d632c
6
+ metadata.gz: e45100ee3ca7cbb65a72cbf4dcec32b155821a923a8ce91c1e6f284412f9dd8c82bf06d4593615776755a867a842e74919bde758e881fd49d9dd905eb11574bf
7
+ data.tar.gz: a03d40326111b14fe5420bc1aa9a81b9d9a88ea3adba41971333cbfdfae043e211818c860f74ad99bc96668efc83946575501256e6ee744dc6192719f1bd21e1
data/README.md CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
  ### Get the gem
6
6
 
7
- The Ruby SDK is available [via Rubygems](https://rubygems.org/gems/chain-sdk). Make sure to use the most recent version whose major and minor components (`major.minor.x`) match your version of Chain Core. Ruby 2 is required.
7
+ The Ruby SDK is available [via Rubygems](https://rubygems.org/gems/chain-sdk). Make sure to use the most recent version whose major and minor components (`major.minor.x`) match your version of Chain Core. Ruby 2.1 or greater is required.
8
8
 
9
9
  For most applications, you can simply add the following to your `Gemfile`:
10
10
 
11
11
  ```
12
- gem 'chain-sdk', '~> 1.0.0', require: 'chain'
12
+ gem 'chain-sdk', '~> 1.0.1', require: 'chain'
13
13
  ```
14
14
 
15
15
  ### In your code
@@ -79,6 +79,10 @@ module Chain
79
79
  # @return [String]
80
80
  attrib :core_id
81
81
 
82
+ # @!attribute [r] version
83
+ # @return [String]
84
+ attrib :version
85
+
82
86
  # @!attribute [r] build_commit
83
87
  # @return [String]
84
88
  attrib :build_commit
@@ -5,7 +5,7 @@ module Chain
5
5
  # @return [Client]
6
6
  attr_reader :client
7
7
 
8
- def initialize(client, first_query)
8
+ def initialize(client, first_query = {})
9
9
  @client = client
10
10
  @first_query = first_query
11
11
  end
@@ -25,7 +25,7 @@ module Chain
25
25
  attrib_name = attrib_name.to_sym
26
26
  raise KeyError.new("key not found: #{attrib_name}") unless self.class.attrib_opts.key?(attrib_name)
27
27
 
28
- instance_variable_get "@{attrib_name}"
28
+ instance_variable_get "@#{attrib_name}"
29
29
  end
30
30
 
31
31
  def []=(attrib_name, value)
@@ -3,6 +3,7 @@ require 'securerandom'
3
3
  require_relative './client_module'
4
4
  require_relative './connection'
5
5
  require_relative './constants'
6
+ require_relative './query'
6
7
  require_relative './response_object'
7
8
 
8
9
  module Chain
@@ -94,6 +95,30 @@ module Chain
94
95
  TransactionFeed.new(client.conn.request('get-transaction-feed', opts), client.conn)
95
96
  end
96
97
 
98
+ # @param [Hash] opts
99
+ # @option opts [String] :id ID of the transaction feed. You must provide either :id or :alias.
100
+ # @option opts [String] :alias ID of the transaction feed. You must provide either :id or :alias.
101
+ # @return [void]
102
+ def delete(opts)
103
+ client.conn.request('delete-transaction-feed', opts)
104
+ nil
105
+ end
106
+
107
+ # @return [Query]
108
+ def query
109
+ Query.new(client)
110
+ end
111
+
112
+ end
113
+
114
+ class Query < Chain::Query
115
+ def fetch(query)
116
+ client.conn.request('list-transaction-feeds', query)
117
+ end
118
+
119
+ def translate(raw)
120
+ TransactionFeed.new(raw, client.conn)
121
+ end
97
122
  end
98
123
 
99
124
  end
@@ -1,3 +1,3 @@
1
1
  module Chain
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chain-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chain Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-17 00:00:00.000000000 Z
11
+ date: 2017-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,7 +64,7 @@ dependencies:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: 0.9.5
67
- description: The Official Ruby SDK for the Chain Core Developer Edition
67
+ description: The Official Ruby SDK for Chain Core
68
68
  email:
69
69
  executables: []
70
70
  extensions: []
@@ -103,9 +103,9 @@ require_paths:
103
103
  - lib
104
104
  required_ruby_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ">="
106
+ - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '0'
108
+ version: '2.1'
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - ">="
@@ -113,8 +113,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.5.1
116
+ rubygems_version: 2.5.2
117
117
  signing_key:
118
118
  specification_version: 4
119
- summary: The Official Ruby SDK for the Chain Core Developer Edition
119
+ summary: The Official Ruby SDK for Chain Core
120
120
  test_files: []