Class: IcAgent::Candid::PrimitiveType

Inherits:
BaseType
  • Object
show all
Defined in:
lib/ic_agent/candid.rb

Instance Method Summary collapse

Methods inherited from BaseType

_build_type_table_impl, #build_type_table, check_type, covariant, decode_value, #display, encode_type, encode_value

Constructor Details

#initializePrimitiveType

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