Class: Chain::Asset::ClientModule
Instance Attribute Summary
Attributes inherited from ClientModule
#client
Instance Method Summary
collapse
#initialize
Instance Method Details
#create(opts) ⇒ Asset
61
62
63
64
|
# File 'lib/chain/asset.rb', line 61
def create(opts)
opts = {client_token: SecureRandom.uuid}.merge(opts)
client.conn.singleton_batch_request('create-asset', [opts]) { |item| Asset.new(item) }
end
|
68
69
70
71
|
# File 'lib/chain/asset.rb', line 68
def create_batch(opts)
opts = opts.map { |i| {client_token: SecureRandom.uuid}.merge(i) }
client.conn.batch_request('create-asset', opts) { |item| Asset.new(item) }
end
|
#query(opts = {}) ⇒ Query
92
93
94
|
# File 'lib/chain/asset.rb', line 92
def query(opts = {})
Query.new(client, opts)
end
|
Returns a success message.
78
79
80
|
# File 'lib/chain/asset.rb', line 78
def update_tags(opts)
client.conn.singleton_batch_request('update-asset-tags', [opts])
end
|
84
85
86
|
# File 'lib/chain/asset.rb', line 84
def update_tags_batch(opts)
client.conn.batch_request('update-asset-tags', opts)
end
|