Class: Depix::Binary::Fields::InnerField
- Inherits:
-
Field
- Object
- Field
- Depix::Binary::Fields::InnerField
show all
- Defined in:
- lib/depix/binary/fields.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, #explain, #initialize
Instance Attribute Details
#cast ⇒ Object
Returns the value of attribute cast.
316
317
318
|
# File 'lib/depix/binary/fields.rb', line 316
def cast
@cast
end
|
Instance Method Details
#consume!(stack) ⇒ Object
327
328
329
|
# File 'lib/depix/binary/fields.rb', line 327
def consume!(stack)
cast.consume!(stack)
end
|
#length ⇒ Object
319
320
321
|
# File 'lib/depix/binary/fields.rb', line 319
def length
cast.length
end
|
#pack(value) ⇒ Object
340
341
342
|
# File 'lib/depix/binary/fields.rb', line 340
def pack(value)
cast.pack(value)
end
|
#pattern ⇒ Object
323
324
325
|
# File 'lib/depix/binary/fields.rb', line 323
def pattern
cast.pattern
end
|
#rtype ⇒ Object
331
332
333
|
# File 'lib/depix/binary/fields.rb', line 331
def rtype
cast
end
|
#validate!(value) ⇒ Object
335
336
337
338
|
# File 'lib/depix/binary/fields.rb', line 335
def validate!(value)
super(value)
cast.validate!(value) if cast.respond_to?(:validate!) && (!value.nil? || req?)
end
|