Method: Meteor::ParserFactory#options=

Defined in:
lib/meteor.rb

#options=(opts) ⇒ Object

set options (オプションをセットする)

Parameters:

  • opts (Hash)

    option (オプション)

  • @deprecated (Hash)

    a customizable set of options

Options Hash (opts):

  • :root (String)

    root directory (基準ディレクトリ)

  • :enc (String)

    default character encoding (デフォルト文字エンコーディング)

  • :type (FixNum, Symbol)

    default type of parser (デフォルトのパーサ・タイプ)



897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
# File 'lib/meteor.rb', line 897

def options=(opts)
  if opts.kind_of?(Hash)
    if opts.include?(:root)
      @root = opts[:root]
    elsif opts.include?(:base_dir)
      @root = opts[:base_dir]
    end
    if opts.include?(:enc)
      @enc = opts[:enc]
    elsif opts.include?(:base_enc)
      @enc = opts[:base_enc]
    end
    if opts.include?(:type)
      @type = opts[:type]
    elsif opts.include?(:base_type)
      @type = opts[:base_type]
    end
  else
    raise ArgumentError
  end
end