Included Modules

Files

Class/Module Index [+]

Quicksearch

BinData::SanitizedFields

Attributes

fields[R]

Public Class Methods

new(endian) click to toggle source
# File lib/bindata/sanitize.rb, line 72
def initialize(endian)
  @fields = []
  @endian = endian
end

Public Instance Methods

[](idx) click to toggle source
# File lib/bindata/sanitize.rb, line 84
def [](idx)
  @fields[idx]
end
add_field(type, name, params) click to toggle source
# File lib/bindata/sanitize.rb, line 78
def add_field(type, name, params)
  name = nil if name == ""

  @fields << SanitizedField.new(name, type, params, @endian)
end
all_field_names_blank?() click to toggle source
# File lib/bindata/sanitize.rb, line 108
def all_field_names_blank?
  @fields.all? { |f| f.name == nil }
end
any_field_has_parameter?(parameter) click to toggle source
# File lib/bindata/sanitize.rb, line 116
def any_field_has_parameter?(parameter)
  @fields.any? { |f| f.has_parameter?(parameter) }
end
copy_fields(other) click to toggle source
# File lib/bindata/sanitize.rb, line 120
def copy_fields(other)
  @fields.concat(other.fields)
end
each(&block) click to toggle source
# File lib/bindata/sanitize.rb, line 96
def each(&block)
  @fields.each(&block)
end
empty?() click to toggle source
# File lib/bindata/sanitize.rb, line 88
def empty?
  @fields.empty?
end
field_names() click to toggle source
# File lib/bindata/sanitize.rb, line 100
def field_names
  @fields.collect { |field| field.name_as_sym }
end
has_field_name?(name) click to toggle source
# File lib/bindata/sanitize.rb, line 104
def has_field_name?(name)
  @fields.detect { |f| f.name_as_sym == name.to_sym }
end
length() click to toggle source
# File lib/bindata/sanitize.rb, line 92
def length
  @fields.length
end
no_field_names_blank?() click to toggle source
# File lib/bindata/sanitize.rb, line 112
def no_field_names_blank?
  @fields.all? { |f| f.name != nil }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.