stratumn_sdk 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/lib/stratumn_sdk/link.rb +5 -5
- data/lib/stratumn_sdk/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: 96a0f25a4a3767eeb3f3c54518300534355fda7a
|
4
|
+
data.tar.gz: d6e7507e0b4c4773988e0f593d72e3abc220b5c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec904a1adfe462f1eaf95b3b544239ba4fc842c477f63f6e73f7f3389640fdb5712ff9178a4bcbb903a45019c34daf7f6f08fc2647611eb76f01bff09ae3136e
|
7
|
+
data.tar.gz: b3ff43ad083c509e8026967149466663fae9b08ed6dd4fbd149d965cf79005feaeeed99aba920dfeb7bd28658f4fc844ae0533a5effd9e3ab75f8b4532cd7ba4
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -63,6 +63,7 @@ Returns an existing link.
|
|
63
63
|
```ruby
|
64
64
|
application = StratumnSdk::Application.load('quickstart')
|
65
65
|
link = application.get_link('aee5427')
|
66
|
+
puts link.link_hash
|
66
67
|
```
|
67
68
|
|
68
69
|
#### StratumnSdk::get_map(map_id, tags = [])
|
@@ -95,7 +96,7 @@ previous = link.previous
|
|
95
96
|
|
96
97
|
#### StratumnSdk::Link#load
|
97
98
|
|
98
|
-
|
99
|
+
Loads a full link. Can be useful when you only have the meta data of links.
|
99
100
|
|
100
101
|
```ruby
|
101
102
|
application = StratumnSdk::Application.load('quickstart')
|
data/lib/stratumn_sdk/link.rb
CHANGED
@@ -5,7 +5,7 @@ module StratumnSdk
|
|
5
5
|
include Request
|
6
6
|
include Helper
|
7
7
|
|
8
|
-
attr_accessor :application, :meta, :state, :link, :
|
8
|
+
attr_accessor :application, :meta, :state, :link, :link_hash
|
9
9
|
|
10
10
|
def initialize(application, obj)
|
11
11
|
self.application = application
|
@@ -13,7 +13,7 @@ module StratumnSdk
|
|
13
13
|
self.link = obj['link']
|
14
14
|
self.meta = link['meta']
|
15
15
|
self.state = link['state']
|
16
|
-
self.
|
16
|
+
self.link_hash = obj['meta']['linkHash']
|
17
17
|
|
18
18
|
application.agent_info['functions'].each do |(method, _)|
|
19
19
|
add_transition_method(method)
|
@@ -25,11 +25,11 @@ module StratumnSdk
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def get_branches(tags)
|
28
|
-
application.get_branches(
|
28
|
+
application.get_branches(link_hash, tags)
|
29
29
|
end
|
30
30
|
|
31
31
|
def load
|
32
|
-
application.get_link(
|
32
|
+
application.get_link(link_hash)
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.load(segment)
|
@@ -47,7 +47,7 @@ module StratumnSdk
|
|
47
47
|
|
48
48
|
def add_transition_method(method)
|
49
49
|
define_singleton_method(method) do |*args|
|
50
|
-
url = "#{application.url}/links/#{
|
50
|
+
url = "#{application.url}/links/#{link_hash}/#{method}"
|
51
51
|
|
52
52
|
result = post(url, json: args)
|
53
53
|
|
data/lib/stratumn_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stratumn_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stratumn Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|