Creates new Pos instance
 @param [Hash] options options hash
 @return [Object] Pos object
169345
def validate_options!
      raise PosInvalid.new('Missing pos_id parameter') if pos_id.nil? || pos_id == 0
      raise PosInvalid.new('Missing pos_auth_key parameter') if pos_auth_key.nil? || pos_auth_key == ''
      raise PosInvalid.new('Missing key1 parameter') if key1.nil? || key1 == ''
      raise PosInvalid.new('Missing key2 parameter') if key2.nil? || key2 == ''
      raise PosInvalid.new("Invalid variant parameter, expected one of these: #{TYPES.join(', ')}") unless TYPES.include?(variant)
      raise PosInvalid.new("Invalid encoding parameter, expected one of these: #{ENCODINGS.join(', ')}") unless ENCODINGS.include?(encoding)
    end
371639
def create(proto, *args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      raise ArgumentError, "proto #{proto} must be protocol" unless proto.is_a?(Protocol)
      raise ArgumentError, "command structure mismatch" if !options.empty? && structure.instance_of?(RLP::Sedes::CountableList)
      options.empty? ? args : options
    end
273245
def ruby(*args, &block)
      options = args.last.is_a?(Hash) ? args.pop : {}
      if args.length > 1
        run(*([RUBY] + args + [options]), &block)
      else
        run("#{RUBY} #{args.first}", options, &block)
      end
    end
1219439
def store_pos(mdTopLt, mdBotRt, x1, y1, x2, y2)  # :nodoc:
    record  = 0x104F     # Record identifier.
    length  = 0x0014     # Number of bytes to follow.
    # mdTopLt            # Top left.
    # mdBotRt            # Bottom right.
    # x1                 # X coordinate.
    # y1                 # Y coordinate.
    # x2                 # Width.
    # y2                 # Height.

    header = [record, length].pack('vv')
    data  = [mdTopLt].pack('v')
    data += [mdBotRt].pack('v')
    data += [x1].pack('V')
    data += [y1].pack('V')
    data += [x2].pack('V')
    data += [y2].pack('V')

    append(header, data)
  end
1314086
def option(opts, *args)
      long_opt_symbol = long_opt_symbol(args)
      args += Array(OptionsHelp::TEXT[long_opt_symbol])
      opts.on(*args) do |arg|
        @options[long_opt_symbol] = arg
        yield arg if block_given?
      end
    end
1096257
function BlockTemplate(options) {
  if (!(this instanceof BlockTemplate))
    return new BlockTemplate(options);

  this.prevBlock = encoding.NULL_HASH;
  this.version = 1;
  this.height = 0;
  this.time = 0;
  this.bits = 0;
  this.target = encoding.ZERO_HASH;
  this.locktime = 0;
  this.mtp = 0;
  this.flags = 0;
  this.coinbaseFlags = DUMMY;
  this.witness = false;
  this.address = new Address();
  this.reserve = new Address();
  this.sigops = 400;
  this.weight = 4000;
  this.interval = 210000;
  this.fees = 0;
  this.tree = new MerkleTree();
  this.commitment = encoding.ZERO_HASH;
  this.left = DUMMY;
  this.right = DUMMY;
  this.items = [];

  if (options)
    this.fromOptions(options);
}
129279
def with_default_options(options)
      config = RSpec.configuration

      {
        cookbook_root: config.cookbook_root || calling_cookbook_root(options, caller),
        cookbook_path: config.cookbook_path || calling_cookbook_path(options, caller),
        role_path:     config.role_path || default_role_path,
        environment_path: config.environment_path || default_environment_path,
        file_cache_path: config.file_cache_path,
        log_level:     config.log_level,
        path:          config.path,
        platform:      config.platform,
        version:       config.version,
      }.merge(options)
    end
1026106
def create(*params, &block)
      options = {:query => {}}
      options[:query] = params[0] if params.length > 0
      response = self.class.post '/projects/jobs', options
      yield(response) if block_given?
      response
    end
854249
def options
      map = ChefAPI::Configurable.keys.map do |key|
        [key, instance_variable_get(:"@#{key}")]
      end
      Hash[map]
    end
728882
def new_transaction(options = {})
      options = options.dup

      options.merge!({
        :pos_id => @pos_id,
        :pos_auth_key => @pos_auth_key,
        :gateway_url => options[:gateway_url] || @gateway_url,
        :key1 => @key1,
        :encoding => encoding,
        :variant => variant
      })

      if !options.has_key?(:add_signature)
        options[:add_signature] = add_signature?
      end

      if !options.has_key?(:pay_type)
        options[:pay_type] = test_payment? ? 't' : nil
      end

      Transaction.new(options)
    end
1120070
def options
      @options ||= {
        # Upload options
        :endpoint          => nil,
        :username          => Config.username,
        :key               => Config.key,
        :extended_metadata => true,
        :ssl_verify        => true,

        # Git options
        :remote => 'origin',
        :branch => 'master',
        :sign   => false,

        # Artifactory options
        :artifactory     => false,
        :artifactory_key => ENV['ARTIFACTORY_API_KEY'],

        # Global options
        :log_level => :warn,
        :path      => Dir.pwd,
      }
    end
12033
function createOptions(options) {
    var object = optionsCache[options] = {};(options.match(rnotwhite) || []).forEach(function (flag) {
        object[flag] = true;
    });
    return object;
}
1219987
def handle_options
      options.rakelib = ['rakelib']
      options.trace_output = $stderr

      OptionParser.new do |opts|
        opts.banner = "#{Rake.application.name} [-f rakefile] {options} targets..."
        opts.separator ""
        opts.separator "Options are ..."

        opts.on_tail("-h", "--help", "-H", "Display this help message.") do
          puts opts
          exit
        end

        standard_rake_options.each { |args| opts.on(*args) }
        opts.environment('RAKEOPT')
      end.parse!
    end
954375
function newPutOne(endpoint, options) {
    // for backwards-compatibility <= 0.11.1
    if (_.isArray(options)) options = { allowable: options };
    else options = options || {};
    options.method = "put";
    return newPostOne(endpoint, options);
}
1244336
def options
      OPTIONS_KEYS.inject({}) do |options, key|
        options.merge!(key => send(key))
      end
    end
765076
def create(key, value, options = {})
      if key? key
        false
      else
        store(key, value, options)
        true
      end
    end
358733
def create(value, options = {})
      custom_params = use_cas(@options)
      @raw = send_put_request(@conn, ['/v1/acl/create'], options, value, custom_params)
      parse_body
    end