Class: Depix::InnerField

Inherits:
Field
  • Object
show all
Defined in:
lib/depix/dict.rb

Overview

Wrapper for a contained structure

Instance Attribute Summary collapse

Attributes inherited from Field

#desc, #name, #req

Instance Method Summary collapse

Methods inherited from Field

#clean, emit_char, emit_r32, emit_u16, emit_u32, emit_u8, #explain, #initialize

Constructor Details

This class inherits a constructor from Depix::Field

Instance Attribute Details

#castObject

Returns the value of attribute cast.



307
308
309
# File 'lib/depix/dict.rb', line 307

def cast
  @cast
end

Instance Method Details

#consume!(stack) ⇒ Object



318
319
320
# File 'lib/depix/dict.rb', line 318

def consume!(stack)
  cast.consume!(stack)
end

#lengthObject



310
311
312
# File 'lib/depix/dict.rb', line 310

def length
  cast.length
end

#pack(value) ⇒ Object



331
332
333
# File 'lib/depix/dict.rb', line 331

def pack(value)
  cast.pack(value)
end

#patternObject



314
315
316
# File 'lib/depix/dict.rb', line 314

def pattern
  cast.pattern
end

#rtypeObject



322
323
324
# File 'lib/depix/dict.rb', line 322

def rtype
  cast
end

#validate!(value) ⇒ Object



326
327
328
329
# File 'lib/depix/dict.rb', line 326

def validate!(value)
  super(value)
  cast.validate!(value) if cast.respond_to?(:validate!) && (!value.nil? || req?)
end