Class: CLType
- Inherits:
-
Object
show all
- Defined in:
- lib/types/cl_type.rb
Overview
Casper types, i.e. types which can be stored and manipulated by smart contracts. Provides a description of the underlying data type of a CLValue.
Direct Known Subclasses
CLAccountHashType, CLAnyType, CLBoolType, CLByteArrayType, CLI32Type, CLI64Type, CLKeyType, CLListType, CLMapType, CLOptionType, CLPublicKeyType, CLResultType, CLStringType, CLTupleType, CLU128Type, CLU256Type, CLU32Type, CLU512Type, CLU64Type, CLU8Type, CLURefType, CLUnitType
Constant Summary
collapse
- TAGS =
{
Bool: 0,
I32: 1,
I64: 2,
U8: 3,
U32: 4,
U64: 5,
U128: 6,
U256: 7,
U512: 8,
Unit: 9,
String: 10,
Key: 11,
URef: 12,
Option: 13,
List: 14,
ByteArray: 15,
Result: 16,
Map: 17,
Tuple1: 18,
Tuple2: 19,
Tuple3: 20,
Any: 21,
PublicKey: 22
}
Instance Method Summary
collapse
Constructor Details
#initialize(value = nil) ⇒ CLType
Returns a new instance of CLType.
55
56
57
|
# File 'lib/types/cl_type.rb', line 55
def initialize(value = nil)
@value = value
end
|
Instance Method Details
#get_cl_type_tag(key) ⇒ Object
72
73
74
|
# File 'lib/types/cl_type.rb', line 72
def get_cl_type_tag(key)
TAGS[key]
end
|
#get_link_to ⇒ Object
68
69
70
|
# File 'lib/types/cl_type.rb', line 68
def get_link_to
end
|
#get_tag_key(value) ⇒ String
78
79
80
|
# File 'lib/types/cl_type.rb', line 78
def get_tag_key(value)
TAGS.key(value).to_s
end
|
#get_tag_value ⇒ Integer
83
84
85
|
# File 'lib/types/cl_type.rb', line 83
def get_tag_value
@tag_value
end
|
87
88
89
|
# File 'lib/types/cl_type.rb', line 87
def get_tags
TAGS
end
|
#tag_value_isvalid(value) ⇒ Boolean
93
94
95
|
# File 'lib/types/cl_type.rb', line 93
def tag_value_isvalid(value)
TAGS.has_value?(value)
end
|
#to_json ⇒ Object
64
65
66
|
# File 'lib/types/cl_type.rb', line 64
def to_json
end
|
#to_string ⇒ String
60
61
62
|
# File 'lib/types/cl_type.rb', line 60
def to_string
end
|