Class: IcAgent::Candid::ReservedClass

Inherits:
PrimitiveType show all
Defined in:
lib/ic_agent/candid.rb

Overview

Represents an IDL Reserved

Instance Method Summary collapse

Methods inherited from PrimitiveType

#_build_type_table_impl, #check_type

Methods inherited from BaseType

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

Constructor Details

#initializeReservedClass

Returns a new instance of ReservedClass.



284
285
286
# File 'lib/ic_agent/candid.rb', line 284

def initialize
  super
end

Instance Method Details

#covariant(x) ⇒ Object



288
289
290
# File 'lib/ic_agent/candid.rb', line 288

def covariant(x)
  true
end

#decode_value(b, t) ⇒ Object



300
301
302
303
304
305
# File 'lib/ic_agent/candid.rb', line 300

def decode_value(b, t)
  if name != t.name
    t.decode_value(b, t)
  end
  nil
end

#encode_type(type_table = nil) ⇒ Object



296
297
298
# File 'lib/ic_agent/candid.rb', line 296

def encode_type(type_table = nil)
  LEB128.encode_signed(TypeIds::Reserved).string
end

#encode_valueObject



292
293
294
# File 'lib/ic_agent/candid.rb', line 292

def encode_value
  ''
end

#idObject



311
312
313
# File 'lib/ic_agent/candid.rb', line 311

def id
  TypeIds::Reserved
end

#nameObject



307
308
309
# File 'lib/ic_agent/candid.rb', line 307

def name
  'reserved'
end