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.



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

def cast
  @cast
end

Instance Method Details

#consume!(stack) ⇒ Object



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

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

#lengthObject



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

def length
  cast.length
end

#pack(value) ⇒ Object



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

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

#patternObject



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

def pattern
  cast.pattern
end

#rtypeObject



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

def rtype
  cast
end

#validate!(value) ⇒ Object



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

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