class Faker::Blockchain::Aeternity
Public Class Methods
address()
click to toggle source
Produces a random Aeternity
wallet address
@return [String]
@example
Faker::Blockchain::Aeternity.address #=> "ak_zvU8YQLagjcfng7Tg8yCdiZ1rpiWNp1PBn3vtUs44utSvbJVR"
# File lib/faker/blockchain/aeternity.rb, line 16 def address "ak_#{rand_strings}" end
contract()
click to toggle source
Produces a random Aeternity
contract
@return [String]
@example
Faker::Blockchain::Aeternity.contract #=> "ct_Hk2JsNeWGEYQEHHQCfcBeGrwbhtYSwFTPdDhW2SvjFYVojyhW"
# File lib/faker/blockchain/aeternity.rb, line 42 def contract "ct_#{rand_strings}" end
oracle()
click to toggle source
Produces a random Aeternity
oracle
@return [String]
@example
Faker::Blockchain::Aeternity.oracle #=> "ok_28QDg7fkF5qiKueSdUvUBtCYPJdmMEoS73CztzXCRAwMGKHKZh"
# File lib/faker/blockchain/aeternity.rb, line 55 def oracle "ok_#{rand_strings(51)}" end
transaction()
click to toggle source
Produces a random Aeternity
transaction
@return [String]
@example
Faker::Blockchain::Aeternity.transaction #=> "th_147nDP22h3pHrLt2qykTH4txUwQh1ccaXp"
# File lib/faker/blockchain/aeternity.rb, line 29 def transaction "th_#{rand_strings(51)}" end
Protected Class Methods
rand_strings(length = 50)
click to toggle source
# File lib/faker/blockchain/aeternity.rb, line 61 def rand_strings(length = 50) hex_alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' var = +'' length.times { var << sample(shuffle(hex_alphabet.split(''))) } var end