Object
ArgProcessors process the arguments passed to BinData::Base.new into the form required to initialise the BinData object.
Any passed parameters are sanitized so the BinData object doesn’t need to perform error checking on the parameters.
Takes the arguments passed to BinData::Base.new and extracts [value, sanitized_parameters, parent].
# File lib/bindata/base.rb, line 277 def extract_args(obj_class, obj_args) value, params, parent = separate_args(obj_class, obj_args) sanitized_params = SanitizedParameters.sanitize(params, obj_class) [value, sanitized_params, parent] end
Performs sanity checks on the given parameters. This method converts the parameters to the form expected by the data object.
# File lib/bindata/base.rb, line 310 def sanitize_parameters!(obj_class, obj_params) end
Separates the arguments passed to BinData::Base.new into [value, parameters, parent]. Called by extract_args.
# File lib/bindata/base.rb, line 286 def separate_args(obj_class, obj_args) args = obj_args.dup value = parameters = parent = nil if args.length > 1 and args.last.is_a? BinData::Base parent = args.pop end if args.length > 0 and args.last.is_a? Hash parameters = args.pop end if args.length > 0 value = args.pop end parameters ||= @@empty_hash return [value, parameters, parent] end
Generated with the Darkfish Rdoc Generator 2.