Class: Casper::Entity::Deploy

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

Overview

Deploy, an item containing a smart contract along with the requester's signature(s).

Instance Method Summary collapse

Constructor Details

#initialize(hash, header, payment, session, approvals) ⇒ Deploy

Returns a new instance of Deploy.

Parameters:



11
12
13
14
15
16
17
# File 'lib/entity/deploy.rb', line 11

def initialize(hash, header, payment, session, approvals)
  @hash = hash
  @header = header
  @payment = payment
  @session = session
  @approvals = approvals
end

Instance Method Details

#add_approval(approval) ⇒ Object

Parameters:



53
54
55
# File 'lib/entity/deploy.rb', line 53

def add_approval(approval)
  @approvals << approval
end

#get_approvalsDeployApproval

Returns approvals.

Returns:



48
49
50
# File 'lib/entity/deploy.rb', line 48

def get_approvals
  @approvals  
end

#get_hashString

Returns hash.

Returns:

  • (String)

    hash



20
21
22
# File 'lib/entity/deploy.rb', line 20

def get_hash
  @hash 
end

#get_headerDeployHeader

Returns header.

Returns:



25
26
27
# File 'lib/entity/deploy.rb', line 25

def get_header
  @header 
end

#get_paymentDeployExecutable

Returns payment.

Returns:



30
31
32
# File 'lib/entity/deploy.rb', line 30

def get_payment 
  @payment  
end

#get_sessionDeployExecutable

Returns session.

Returns:



39
40
41
# File 'lib/entity/deploy.rb', line 39

def get_session 
  @session  
end

#set_payment(payment = {}) ⇒ Object



34
35
36
# File 'lib/entity/deploy.rb', line 34

def set_payment(payment = {})
  @payment = payment
end

#set_session(session = {}) ⇒ Object



43
44
45
# File 'lib/entity/deploy.rb', line 43

def set_session(session = {})
  @session = session
end

#to_hashHash

Returns header as a hash.

Returns:

  • (Hash)

    header as a hash



58
59
60
61
62
63
64
65
66
# File 'lib/entity/deploy.rb', line 58

def to_hash
  h = {}
  h[:hash] = @hash
  h[:header] = @header
  h[:payment] = @payment 
  h[:session] = @session
  h[:approvals] = @approvals
  return h
end