Module: MixinBot::API::Snapshot
- Included in:
- MixinBot::API
- Defined in:
- lib/mixin_bot/api/snapshot.rb
Instance Method Summary collapse
- #network_snapshot(snapshot_id, **options) ⇒ Object (also: #read_network_snapshot)
- #network_snapshots(**options) ⇒ Object (also: #read_network_snapshots)
- #snapshots(**options) ⇒ Object (also: #read_snapshots)
Instance Method Details
#network_snapshot(snapshot_id, **options) ⇒ Object Also known as: read_network_snapshot
36 37 38 39 40 41 42 |
# File 'lib/mixin_bot/api/snapshot.rb', line 36 def network_snapshot(snapshot_id, **) path = format('/network/snapshots/%<snapshot_id>s', snapshot_id: snapshot_id) access_token = [:access_token] || access_token('GET', path) = format('Bearer %<access_token>s', access_token: access_token) client.get(path, headers: { 'Authorization': }) end |
#network_snapshots(**options) ⇒ Object Also known as: read_network_snapshots
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mixin_bot/api/snapshot.rb', line 6 def network_snapshots(**) path = format( '/network/snapshots?limit=%<limit>s&offset=%<offset>s&asset=%<asset>s&order=%<order>s', limit: [:limit], offset: [:offset], asset: [:asset], order: [:order] ) access_token = [:access_token] || access_token('GET', path) = format('Bearer %<access_token>s', access_token: access_token) client.get(path, headers: { 'Authorization': }) end |
#snapshots(**options) ⇒ Object Also known as: read_snapshots
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mixin_bot/api/snapshot.rb', line 21 def snapshots(**) path = format( '/snapshots?limit=%<limit>s&offset=%<offset>s&asset=%<asset>s&opponent=%<opponent>s', limit: [:limit], offset: [:offset], asset: [:asset], opponent: [:opponent] ) access_token = [:access_token] || access_token('GET', path) = format('Bearer %<access_token>s', access_token: access_token) client.get(path, headers: { 'Authorization': }) end |