Class: Casper::Entity::Deploy
- Inherits:
-
Object
- Object
- Casper::Entity::Deploy
- 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
- #add_approval(approval) ⇒ Object
-
#get_approvals ⇒ DeployApproval
Approvals.
-
#get_hash ⇒ String
Hash.
-
#get_header ⇒ DeployHeader
Header.
-
#get_payment ⇒ DeployExecutable
Payment.
-
#get_session ⇒ DeployExecutable
Session.
-
#initialize(hash, header, payment, session, approvals) ⇒ Deploy
constructor
A new instance of Deploy.
- #set_payment(payment = {}) ⇒ Object
- #set_session(session = {}) ⇒ Object
-
#to_hash ⇒ Hash
Header as a hash.
Constructor Details
#initialize(hash, header, payment, session, approvals) ⇒ Deploy
Returns a new instance of Deploy.
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
53 54 55 |
# File 'lib/entity/deploy.rb', line 53 def add_approval(approval) @approvals << approval end |
#get_approvals ⇒ DeployApproval
Returns approvals.
48 49 50 |
# File 'lib/entity/deploy.rb', line 48 def get_approvals @approvals end |
#get_hash ⇒ String
Returns hash.
20 21 22 |
# File 'lib/entity/deploy.rb', line 20 def get_hash @hash end |
#get_header ⇒ DeployHeader
Returns header.
25 26 27 |
# File 'lib/entity/deploy.rb', line 25 def get_header @header end |
#get_payment ⇒ DeployExecutable
Returns payment.
30 31 32 |
# File 'lib/entity/deploy.rb', line 30 def get_payment @payment end |
#get_session ⇒ DeployExecutable
Returns session.
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_hash ⇒ Hash
Returns 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 |