Class: Casper::Entity::Transfer

Inherits:
Object
  • Object
show all
Defined in:
lib/entity/transfer.rb

Overview

Represents a transfer from one purse to another

Instance Method Summary collapse

Constructor Details

#initialize(transfer = {}) ⇒ Transfer

Returns a new instance of Transfer.

Parameters:

  • transfer (Hash) (defaults to: {})

Options Hash (transfer):

  • :deploy_hash (String)
  • :from (String)
  • :to (String)
  • :source (String)
  • :target (String)
  • :amount (String)
  • :gas (String)
  • :id (Integer)


15
16
17
18
19
20
21
22
23
24
# File 'lib/entity/transfer.rb', line 15

def initialize(transfer = {})
  @deploy_hash = transfer[:deploy_hash]
  @from = transfer[:from]
  @to = transfer[:to]
  @source = transfer[:source]
  @target = transfer[:target]
  @amount = transfer[:amount]
  @gas = transfer[:gas]
  @id = transfer[:id]
end

Instance Method Details

#get_amountString

Returns transfer amount.

Returns:

  • (String)

    transfer amount



52
53
54
# File 'lib/entity/transfer.rb', line 52

def get_amount
  @amount
end

#get_deploy_hashString

Returns deploy that created the transfer.

Returns:

  • (String)

    deploy that created the transfer



27
28
29
# File 'lib/entity/transfer.rb', line 27

def get_deploy_hash
  @deploy_hash
end

#get_fromString

Returns account from which transfer was executed.

Returns:

  • (String)

    account from which transfer was executed



32
33
34
# File 'lib/entity/transfer.rb', line 32

def get_from
  @from
end

#get_gasString

Returns gas.

Returns:

  • (String)

    gas



57
58
59
# File 'lib/entity/transfer.rb', line 57

def get_gas
  @gas
end

#get_idInteger

Returns user-defined id.

Returns:

  • (Integer)

    user-defined id



61
62
63
# File 'lib/entity/transfer.rb', line 61

def get_id
  @id
end

#get_sourceString

Returns tource purse.

Returns:

  • (String)

    tource purse



42
43
44
# File 'lib/entity/transfer.rb', line 42

def get_source
  @source
end

#get_targetString

Returns target purse.

Returns:

  • (String)

    target purse



47
48
49
# File 'lib/entity/transfer.rb', line 47

def get_target
  @target
end

#get_toString

Returns account to which funds are transferred.

Returns:

  • (String)

    account to which funds are transferred



37
38
39
# File 'lib/entity/transfer.rb', line 37

def get_to
  @to
end