Class: DeployExecutableSerializer
- Inherits:
- 
      Object
      
        - Object
- DeployExecutableSerializer
 
- Defined in:
- lib/serialization/deploy_executable_serializer.rb
Overview
Byte serializer for DeployExecutable object
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ DeployExecutableSerializer 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of DeployExecutableSerializer. 
- #to_bytes(deploy_executable) ⇒ Object
Constructor Details
#initialize ⇒ DeployExecutableSerializer
| 6 7 8 | # File 'lib/serialization/deploy_executable_serializer.rb', line 6 def initialize @deploy_executable = Casper::Entity::DeployExecutable.new end | 
Instance Method Details
#to_bytes(deploy_executable) ⇒ Object
| 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # File 'lib/serialization/deploy_executable_serializer.rb', line 11 def to_bytes(deploy_executable) if deploy_executable.module_bytes? deploy_executable.get_module_bytes.to_bytes elsif deploy_executable.stored_contract_by_hash? deploy_executable.stored_contract_by_hash.to_bytes elsif deploy_executable.stored_contract_by_name? deploy_executable.stored_contract_by_name.to_bytes elsif deploy_executable.stored_versioned_contract_by_hash? deploy_executable.stored_versioned_contract_by_hash.to_bytes elsif deploy_executable.stored_versioned_contract_by_name? deploy_executable.stored_versioned_contract_by_name.to_bytes elsif deploy_executable.transfer? deploy_executable.transfer.to_bytes end end |