Class: IcAgent::Candid::NullClass

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

#initializeNullClass

Returns a new instance of NullClass.



178
179
180
# File 'lib/ic_agent/candid.rb', line 178

def initialize()
  super
end

Instance Method Details

#covariant(x) ⇒ Object



182
183
184
# File 'lib/ic_agent/candid.rb', line 182

def covariant(x)
  x == nil
end

#decode_value(b, t) ⇒ Object



194
195
196
197
# File 'lib/ic_agent/candid.rb', line 194

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

#encode_type(type_table = nil) ⇒ Object



190
191
192
# File 'lib/ic_agent/candid.rb', line 190

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

#encode_value(val) ⇒ Object



186
187
188
# File 'lib/ic_agent/candid.rb', line 186

def encode_value(val)
  ''
end

#idObject



203
204
205
# File 'lib/ic_agent/candid.rb', line 203

def id
  TypeIds::Null
end

#nameObject



199
200
201
# File 'lib/ic_agent/candid.rb', line 199

def name
  'null'
end