Parent

Methods

Files

Class/Module Index [+]

Quicksearch

BinData::BaseArgExtractor

ArgExtractors take the arguments passed to BinData::Base.new and separate them into [value, parameters, parent].

Public Class Methods

extract(the_class, the_args) click to toggle source
# File lib/bindata/base.rb, line 16
def self.extract(the_class, the_args)
  args = the_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

[Validate]

Generated with the Darkfish Rdoc Generator 2.