Add a ChildDeclaration to this mapping

 @param [Symbol] name
 @param [Hash] opts accepts options; expected options: :class

 @return [ChildDeclaration]
960777
def add_child(name, opts = {}, &block)
      delete_property(name)
      properties << ChildDeclaration.new(name, opts.delete(:class), opts, &block)
    end
241255
function(opts) {
  opts = opts || {};

  this.params = {};
  this._params = [];
  this.caseSensitive = opts.caseSensitive;
  this.mergeParams = opts.mergeParams;
  this.strict = opts.strict;
  this.stack = [];
}
1091911
def flag_option(name, description, **config, &block)
      add_option Clin::Option.new(name, description, **config.merge(argument: false), &block)
    end
1082638
function (name, titleToken, options) {
    var child;
    if (!this.get('isResource')) {
      this.set('isResource', true);
    }
    child = route(name, titleToken, options, this);
    child.set('parent', this);
    this.get('children').pushObject(child);
    return this;
  }
384541
def add(name, options={}, &block)
      options = options[:_defaults].(name, options) if options[:_defaults] # FIXME: pipeline?
      base    = options[:_base]

      if options.delete(:inherit) and parent_property = get(name)
        base    = parent_property[:nested]
        options = parent_property.merge(options) # TODO: Definition#merge
      end

      if options[:_nested_builder]
        options[:nested] = build_nested(
          options.merge(
            _base: base,
            _name: name,
            _block: block,
          )
        )
      end

      # clean up, we don't want that stored in the Definition instance.
      [:_defaults, :_base, :_nested_builder, :_features].each { |key| options.delete(key) }

      self[name.to_s] = @definition_class.new(name, options)
    end
680960
def opts name, &b
    fail "command name must be a symbol" unless name.is_a? Symbol

    if name.to_s =~ /[A-Z]/
      fail "Camel-casing is not allowed (#{name})"
    end

    parser = OptionParser.new name.to_s, @ns.shell.fs, &b
    summary = parser.summary?

    parser.specs.each do |opt_name,spec|
      if opt_name.to_s =~ /[A-Z]/
        fail "Camel-casing is not allowed (#{name} option #{opt_name})"
      end
    end

    @ns.commands[name] = Command.new @ns, name, summary, parser
  end
1054054
function opt(options, name, defaultValue){
    return options && options[name]!==undefined ? options[name] : defaultValue;
}
279630
def method_missing(name, *args, &block)
      return add_child(name, *args, &block) if block && block.arity == 0
      add_property(name, *args, &block)
    end
610409
def cell(name, *args)
      name = name.to_s if name
      
      options = args.last.is_a?(Hash) ? args.pop : {}
      options[:namespace] = table.object_name
      args << options
      
      cell = Cell.new(name, *args)
      cells[name] = cell
      builder.define_cell(name) if name
      
      cell
    end
596183
function Options(opts) {

  //### Private properties

  var custfilt = [],
      varset   = {__FILE: '', $__FILE: '""'}

  //### Public Properties

  this.header1    = _defaults.header1
  this.headers    = _defaults.headers
  this.indent     = _defaults.indent
  this.eolType    = _defaults.eolType
  this.emptyLines = _defaults.emptyLines
  this.comments   = _defaults.comments
  this.filter     = _defaults.filter

  this.emitError  = procError     // error "handler"

  //### Public Methods

  this.invalid = function (msg, v) {
    this.emitError('Invalid ' + msg + ' ' + (v != null ? '"' + v + '"' : v))
  }

  this.getVars = function () {
    return varset
  }

  this.setFile = function (file) {
    varset.$__FILE = JSON.stringify(varset.__FILE = file)
  }

  this.def = function (s) {
    var m = s.match(RE_VARPAIR)

    if (m) {
      var k = m[1],
          v = m[2].trim()

      if (!RE_VARNAME.test(k))
        this.invalid('symbol name', k)
      else
        varset[k] = !v ? 1 :
          _fixValue(evalExpr(v, varset, this.emitError))
    }
    else
      this.invalid('symbol name or declaration', s) // only when starts with '='
  }

  this.undef = function (s) {
    var def = s.match(RE_VARNAME)

    if (def)
      delete varset[def[1]]
    else
      this.invalid('symbol name', s)
  }

  this.passFilter = function (str) {
    var i, f, filts

    for (i = 0; i < custfilt.length; ++i) {
      /* istanbul ignore else */
      if (custfilt[i].test(str)) return true
    }
    filts = this.filter
    if (filts === 'all')
      filts = Object.keys(_filters)
    for (i = 0; i < filts.length; ++i) {
      f = _filters[filts[i]]
      if (f.test(str)) return true
    }
    return false
  }

  this.merge = function (opt) {
    if (opt)
      merge.call(this, opt)
    return this
  }

  return this.merge(opts)

  //### Private methods

  // prepare a value for inclussion in the set of variables
  function _fixValue(v) {
    switch (typeof v) {
      case 'number':      // typeof NaN is 'number'
      case 'boolean':
      case 'undefined':
        break
      default:
        // date value returns 'new Date(NaN)' for null dates, ok
        v = v instanceof RegExp ? '' + v :
            v instanceof Date ? '(new Date(' + (+v) + '))' : // eslint-disable-line no-extra-parens
            v == null ? v : JSON.stringify(v)
        break
    }
    return v
  }

  // returns an array as-is or created from a delimited string
  function _split(v) {
    return Array.isArray(v) ? v : v.split(',')
  }

  // Enable filters for comments, 'all' enable all filters
  function _setFilter(filt) {
    filt = filt.trim()
    if (filt === 'all')
      this.filter = filt
    else if (filt in _filters) {
      if (this.filter !== 'all' && this.filter.indexOf(filt) < 0)
        this.filter.push(filt)
    }
    else this.invalid('filter', filt)
  }

  // Creates a custom filter
  function _createFilter(res) {
    for (var i = 0; i < res.length; ++i) {
      var f = res[i]

      if (f instanceof RegExp)
        custfilt.push(f)
      else {
        //console.log('--- creating regex with `' + str + '`')
        try {
          f = new RegExp(f)
          custfilt.push(f)
        }
        catch (e) {
          f = null
        }
        if (!f) this.invalid('custom filter', res[i])
      }
    }
  }

  function _formatHeader(str) {
    return !str ? '' :
      ('' + str)
      .replace(/\r\n?/g, '\n')
      .replace(/\^{1,2}/g, function (c) { return c[1] || '\n' })
  }

  function _setVars(set) {
    for (var k in set) {
      if (RE_VARNAME.test(k))
        varset[k] = _fixValue(set[k])
      else
        this.invalid('symbol name', k)
    }
  }

  /* eslint-disable guard-for-in, complexity */
  function merge(opt) {
    var k, v

    for (k in opt) {
      v = opt[k]

      switch (k) {
        case 'varset':
          _setVars.call(this, v)
          break
        case 'define':
        case 'set':
          _split(v).forEach(this.def, this)
          break
        case 'undef':
        case 'unset':
          _split(v).forEach(this.undef, this)
          break
        case 'filter':
          _split(v).forEach(_setFilter, this)
          break
        case 'customFilter':
          _createFilter(Array.isArray(v) ? v : [v])
          break
        case 'header1':
        case 'headers':
          this[k] = _formatHeader(v)
          break
        case 'emptyLines':
          this[k] = v | 0
          break
        case 'eolType':
          if (/^(?:win|mac|unix)$/.test(v))
            this[k] = v
          else
            this.invalid(k, v)
          break
        case 'comments':
          if (/^(?:all|none|filter)$/.test(v))
            this[k] = v
          else
            this.invalid(k + ' value', v)
          break
        case 'indent':
          if (/^\d+[ts]?/.test(v))
            this[k] = v
          else if (!v)
            this[k] = ''
          else
            this.invalid(k, v)
          break
        default:
          break
      }
      //else
      //  console.log('Ignoring option ' + k)
    }
  }
}
266488
def add_children(parent)
      while tokens = @tokenizer.read_line_tokens()
        if tokens.first.type == :END_BLOCK
          return
					
        elsif tokens.last.type == :START_BLOCK
          # found a child with a block
          tag = construct_tag(tokens[0...-1]);
          add_children(tag)
          parent.add_child(tag)
					
        else
          parent.add_child(construct_tag(tokens))
        end
      end
			
      parse_error("No close block (}).", @tokenizer.line_no, UNKNOWN_POSITION)
    end
897553
def create_option(flag, argument = nil)
      return '' unless flag
      flag = flag.to_s
      return " #{argument}" if flag == 'extra'
      set_pandoc_ruby_options(flag, argument)
      if !argument.nil?
        "#{format_flag(flag)} #{argument}"
      else
        format_flag(flag)
      end
    end
808350
protected function getPluginInstance($name, $opts = array()) {
		$key = strtolower($name);
		if (! isset($this->plugins[$key])) {
			$p_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR . 'plugin.php';
			if (is_file($p_file)) {
				require_once $p_file;
				$class = 'elFinderPlugin' . $name;
				$this->plugins[$key] = new $class($opts);
			} else {
				$this->plugins[$key] = false;
			}
		}
		return $this->plugins[$key];
	}
917384
def add_default_options(opts)
      option "show_help", "-h", "--help", "Show this message"
      option "show_version", "-v", "--version", "Print the name and version"
      option "show_backtrace", "-t", "--trace", "Show the full backtrace when an error occurs"
      opts.on("-v", "--version", "Print the version") do
        puts "#{name} #{version}"
        exit(0)
      end

      opts.on("-t", "--trace", "Show full backtrace if an error occurs") do
        @trace = true
      end

      opts.on_tail("-h", "--help", "Show this message") do
        puts self
        exit
      end
    end
43730
def define_child(name, index)
      define_method(name) do
        children.at(index)
      end
      private name
    end
1055516
function (name, generator, options) {
            options = options || {};
            var inherits = options.inherits,
                inheritsStr = !isUndefined(inherits) ? " INHERITS (" + inherits + ")" : "";
            return format(" %s%s", this._super(arguments), inheritsStr);
        }
616153
@TimerJ
    public CatalogMetadataBuilder withOptions(Map<Selector, Selector> opts) {
        options = new HashMap<Selector, Selector>(opts);
        return this;
    }