Object
A DSLParser parses and accumulates field definitions of the form
type name, params
where:
* +type+ is the under_scored name of a registered type * +name+ is the (possible optional) name of the field * +params+ is a hash containing any parameters
# File lib/bindata/dsl.rb, line 64 def initialize(the_class, parser_type) raise "unknown parser type #{parser_type}" unless parser_abilities[parser_type] @the_class = the_class @parser_type = parser_type @validator = DSLFieldValidator.new(the_class, self) @endian_handler = DSLBigAndLittleEndianHandler.new(the_class) @endian = nil end
# File lib/bindata/dsl.rb, line 109 def dsl_params send(parser_abilities[@parser_type].at(0)) end
# File lib/bindata/dsl.rb, line 76 def endian(endian = nil) if endian set_endian(endian) elsif @endian.nil? pendian = parent_attribute(:endian, nil) set_endian(pendian) if pendian end @endian end
# File lib/bindata/dsl.rb, line 99 def fields unless defined? @fields fields = @endian_handler.ancestor_fields || parent_attribute(:fields) @fields = SanitizedFields.new(endian) @fields.copy_fields(fields) if fields end @fields end
Generated with the Darkfish Rdoc Generator 2.