Class: Depix::Binary::Fields::BlankingField

Inherits:
CharField show all
Defined in:
lib/depix/binary/fields.rb

Overview

For reserved fields and blanking

Instance Attribute Summary

Attributes inherited from Field

#desc, #length, #name, #req

Instance Method Summary collapse

Methods inherited from CharField

#initialize

Methods inherited from Field

#consume!, #explain, #initialize

Constructor Details

This class inherits a constructor from Depix::Binary::Fields::CharField

Instance Method Details

#clean(v) ⇒ Object



251
252
253
# File 'lib/depix/binary/fields.rb', line 251

def clean(v)
  nil
end

#pack(value) ⇒ Object



259
260
261
# File 'lib/depix/binary/fields.rb', line 259

def pack(value)
  0xFF.chr * length
end

#patternObject



247
248
249
# File 'lib/depix/binary/fields.rb', line 247

def pattern
  "Z#{length}"
end

#rtypeObject



255
256
257
# File 'lib/depix/binary/fields.rb', line 255

def rtype
  NilClass
end

#validate!(value) ⇒ Object



243
244
245
# File 'lib/depix/binary/fields.rb', line 243

def validate!(value)
  raise "The value of this field should be nil" unless value.nil?
end