Class: IcAgent::Candid::NullClass

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

Overview

Represents an IDL Null check None == Null ?

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

#initializeNullClass

Returns a new instance of NullClass.



180
181
182
# File 'lib/ic_agent/candid.rb', line 180

def initialize()
  super
end

Instance Method Details

#covariant(x) ⇒ Object



184
185
186
# File 'lib/ic_agent/candid.rb', line 184

def covariant(x)
  x == nil
end

#decode_value(b, t) ⇒ Object



196
197
198
199
# File 'lib/ic_agent/candid.rb', line 196

def decode_value(b, t)
  check_type(t)
  return nil
end

#encode_type(type_table = nil) ⇒ Object



192
193
194
# File 'lib/ic_agent/candid.rb', line 192

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

#encode_value(val) ⇒ Object



188
189
190
# File 'lib/ic_agent/candid.rb', line 188

def encode_value(val)
  ''
end

#idObject



205
206
207
# File 'lib/ic_agent/candid.rb', line 205

def id
  TypeIds::Null
end

#nameObject



201
202
203
# File 'lib/ic_agent/candid.rb', line 201

def name
  'null'
end