Class: IcAgent::Candid::ReservedClass

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

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.



279
280
281
# File 'lib/ic_agent/candid.rb', line 279

def initialize
  super
end

Instance Method Details

#covariant(x) ⇒ Object



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

def covariant(x)
  true
end

#decode_value(b, t) ⇒ Object



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

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

#encode_type(type_table = nil) ⇒ Object



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

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

#encode_valueObject



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

def encode_value
  ''
end

#idObject



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

def id
  TypeIds::Reserved
end

#nameObject



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

def name
  'reserved'
end