Class: Calldata::Text

Inherits:
Calldata show all
Defined in:
lib/calldata/parser.rb

Overview

use embedded classes - why? why not?

e.g. Inscribe, Transfer, ContractCall, ContractCreate/Deploy, etc. 
     use InscribeText, InscribeData/Struct and InscribeBlob - why? why not?

Constant Summary

Constants inherited from Calldata

MAJOR, MINOR, PATCH, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Calldata

banner, decode, encode, parse_data, parse_hex, root, valid_data?, valid_hex?, version

Constructor Details

#initialize(text, type) ⇒ Text

Returns a new instance of Text.



62
63
64
65
# File 'lib/calldata/parser.rb', line 62

def initialize( text, type )
   @text = text
   @type = type   ## parse type (split off parameter and such - why? why not?)
end

Instance Attribute Details

#textObject (readonly)

or use CalldataInscribe or CalldataText or CalldataBlob??



61
62
63
# File 'lib/calldata/parser.rb', line 61

def text
  @text
end

#typeObject (readonly)

or use CalldataInscribe or CalldataText or CalldataBlob??



61
62
63
# File 'lib/calldata/parser.rb', line 61

def type
  @type
end

Instance Method Details

#write(path) ⇒ Object



67
# File 'lib/calldata/parser.rb', line 67

def write( path ) write_text( path, @text ); end