Class: Casper::Entity::DeployHeader

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

Overview

Header information of a Deploy.

Instance Method Summary collapse

Constructor Details

#initialize(header = {}) ⇒ DeployHeader

Returns a new instance of DeployHeader.

Options Hash (header):

  • :account (String)
  • :timestamp (Integer)
  • :ttl (Integer)
  • :gas_price (Integer)
  • :body_hash (String)
  • :dependencies (Array)
  • :chain_name (String)


14
15
16
17
18
19
20
21
22
# File 'lib/entity/deploy_header.rb', line 14

def initialize(header = {})
  @account = header[:account]
  @timestamp = header[:timestamp]
  @ttl = header[:ttl]
  @gas_price = header[:gas_price]
  @body_hash = header[:body_hash]
  @dependencies = header[:dependencies]
  @chain_name = header[:chain_name]
end

Instance Method Details

#get_accountString



26
27
28
# File 'lib/entity/deploy_header.rb', line 26

def 
  @account
end

#get_body_hashString



46
47
48
# File 'lib/entity/deploy_header.rb', line 46

def get_body_hash
  @body_hash
end

#get_chain_nameString



60
61
62
# File 'lib/entity/deploy_header.rb', line 60

def get_chain_name
  @chain_name
end

#get_dependenciesArray



55
56
57
# File 'lib/entity/deploy_header.rb', line 55

def get_dependencies
  @dependencies
end

#get_gas_priceInteger



41
42
43
# File 'lib/entity/deploy_header.rb', line 41

def get_gas_price
  @gas_price
end

#get_timestampInteger



31
32
33
# File 'lib/entity/deploy_header.rb', line 31

def get_timestamp
  @timestamp
end

#get_ttlInteger



36
37
38
# File 'lib/entity/deploy_header.rb', line 36

def get_ttl
  @ttl
end

#set_body_hash(body_hash) ⇒ Object



50
51
52
# File 'lib/entity/deploy_header.rb', line 50

def set_body_hash(body_hash)
  @body_hash = body_hash
end

#to_hashHash



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/entity/deploy_header.rb', line 65

def to_hash
  header = {}
  header[:ttl] = @ttl
  header[:account] = @account
  header[:body_hash] = @body_hash
  header[:gas_price] = @gas_price
  header[:timestamp] = @timestamp
  header[:chain_name] = @chain_name
  header[:dependencies] = @dependencies
  return header
end