module Icss::Meta::FixedType

A Fixed-length buffer. The class size specifies the number of bytes per value (required).

Public Instance Methods

receive(raw) click to toggle source

accept like a string but enforce (violently) the length constraint

Calls superclass method
# File lib/icss/type/structured_schema.rb, line 118
def receive(raw)
  obj = super(raw) ; return nil if obj.blank?
  unless obj.bytesize == self.size then raise FixedValueWrongSizeError.new("Wrong size for a fixed-length type #{self.fullname}: got #{obj.bytesize}, not #{self.size}") ; end
  obj
end
to_schema() click to toggle source
# File lib/icss/type/structured_schema.rb, line 123
def to_schema() _schema.to_hash end