Class: IcAgent::Candid::PrimitiveType
- Defined in:
- lib/ic_agent/candid.rb
Direct Known Subclasses
BoolClass, EmptyClass, FixedIntClass, FixedNatClass, FloatClass, IntClass, NatClass, NullClass, PrincipalClass, ReservedClass, TextClass
Instance Method Summary collapse
- #_build_type_table_impl(type_table = nil) ⇒ Object
- #check_type(t) ⇒ Object
-
#initialize ⇒ PrimitiveType
constructor
A new instance of PrimitiveType.
Methods inherited from BaseType
_build_type_table_impl, #build_type_table, check_type, covariant, decode_value, #display, encode_type, encode_value
Constructor Details
#initialize ⇒ PrimitiveType
Returns a new instance of PrimitiveType.
136 137 138 |
# File 'lib/ic_agent/candid.rb', line 136 def initialize super end |
Instance Method Details
#_build_type_table_impl(type_table = nil) ⇒ Object
148 149 150 151 |
# File 'lib/ic_agent/candid.rb', line 148 def _build_type_table_impl(type_table = nil) # No type table encoding for Primitive types. return end |
#check_type(t) ⇒ Object
140 141 142 143 144 145 146 |
# File 'lib/ic_agent/candid.rb', line 140 def check_type(t) if self.name != t.name raise ValueError, "type mismatch: type on the wire #{t.name}, expect type #{self.name}" end t end |