Class: Sequence::Hello

Inherits:
Object
  • Object
show all
Defined in:
lib/sequence/hello.rb

Instance Method Summary collapse

Constructor Details

#initialize(api, ledger_name) ⇒ Hello

Returns a new instance of Hello.



6
7
8
9
# File 'lib/sequence/hello.rb', line 6

def initialize(api, ledger_name)
  @api = api
  @ledger_name = ledger_name
end

Instance Method Details

#callObject



11
12
13
14
# File 'lib/sequence/hello.rb', line 11

def call
  b = @api.post(SecureRandom.hex(10), '/hello', {ledger_name: @ledger_name})[:parsed_body]
  [b['team_name'], b['addr'], b['addr_ttl_seconds'].to_i]
end