Class: Toshi::Block
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from ApiResource
client, #client, create_many, create_one, #from_hash, #initialize
Class Method Details
.all ⇒ Object
4
5
6
7
|
# File 'lib/toshi/block.rb', line 4
def all
response = client.get '/blocks'
create_many(response)
end
|
.find(identifier) ⇒ Object
9
10
11
12
|
# File 'lib/toshi/block.rb', line 9
def find(identifier)
response = client.get '/blocks/'+identifier.to_s
create_one(response)
end
|
.latest ⇒ Object
14
15
16
17
|
# File 'lib/toshi/block.rb', line 14
def latest
response = client.get '/blocks/latest'
create_one(response)
end
|
Instance Method Details
#transactions ⇒ Object
20
21
22
23
|
# File 'lib/toshi/block.rb', line 20
def transactions
response = client.get '/blocks/'+hash+'/transactions'
self.class.create_one(response)
end
|