Class: BinData::DSLMixin::UnSanitizedFields

Inherits:
Array
  • Object
show all
Defined in:
lib/bindata/dsl.rb

Instance Method Summary collapse

Instance Method Details

#add_field(type, name, params, endian) ⇒ Object



54
55
56
57
58
# File 'lib/bindata/dsl.rb', line 54

def add_field(type, name, params, endian)
  normalized_endian = endian.respond_to?(:endian) ? endian.endian : endian
  normalized_type = RegisteredClasses.normalize_name(type, normalized_endian)
  self << UnSanitizedField.new(normalized_type, name, params)
end

#field_namesObject



50
51
52
# File 'lib/bindata/dsl.rb', line 50

def field_names
  collect { |f| f.name }
end