るりまサーチ

最速Rubyリファレンスマニュアル検索!
382件ヒット [1-100件を表示] (0.138秒)
トップページ > クエリ:I[x] > クエリ:basic[x] > クエリ:new[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. _builtin i
  5. matrix i

検索結果

<< 1 2 3 ... > >>

WEBrick::BasicLog.new(log_file = nil, level = WEBrick::BasicLog::INFO) -> WEBrick::BasicLog (27507.0)

WEBrick::BasicLog オブジェクトを生成して返します。

...rick::BasicLog オブジェクトを生成して返します。

@param log_file ログを記録する先のオブジェクトを指定します。メソッド << が定義されている必要があります。
通常は String オブジェクトか IO オブジェクトです。nil...
...録します。
ログレベルは重要度の順に FATAL, ERROR, WARN, INFO, DEBUG の5段階があります。
FATAL の重要度が一番高く DEBUG が一番低いです。

require 'webrick'
logger = WEBrick::BasicLog.new('testfile', WEBrick::BasicLog::FATAL)...

WEBrick::HTTPAuth::BasicAuth.new(config, default = Config::BasicAuth) -> WEBrick::HTTPAuth::BasicAuth (27501.0)

BasicAuth オブジェクトを生成します。config は設定を保存したハッシュです。

...
Basic
Auth オブジェクトを生成します。config は設定を保存したハッシュです。

config で有効なハッシュキーは以下の通りです。

:Realm =>
:UserDB =>
:Logger =>
:AutoReloadUserDB =>

realm を表す文字列 :Realm には与...
...。:UserDB
には WEBrick::HTTPAuth::Htpasswd オブジェクトを与えます。:Logger には
ロガーオブジェクトを与えます。また、:AutoReloadUserDB には
WEBrick::HTTPAuth::Htpasswd#get_passwd の
reload_db に渡す引数を与えます。

@param config 設定を保持して...
...いるハッシュを指定します。

@param default デフォルトは WEBrick::Config::BasicAuth です。...

OpenSSL::OCSP::BasicResponse.new -> OpenSSL::OCSP::BasicResponse (24301.0)

空の BasicResponse オブジェクトを生成します。

...空の BasicResponse オブジェクトを生成します。

@see OpenSSL::OCSP::Response.create...

WEBrick::HTTPProxyServer.new(config, default = WEBrick::Config::HTTP) -> WEBrick::HTTPProxyServer (21331.0)

プロクシオブジェクトを生成して返します。

...ロクシオブジェクトを生成して返します。

@param config 設定を保存したハッシュを指定します。
設定として有効なハッシュのキーとその値は WEBrick::HTTPServer.new と同じです。
それに加えて以下のキーが有...
...。この proc は
WEBrick::HTTPResponse オブジェクトと WEBrick::HTTPRequest オブジェクトを引数として
proc.call(req, res) のように呼ばれます。
認証に失敗した場合 proc は適切な例外を発生させなければいけません。nil を指定した場合...
...nil です。通常は WEBrick::HTTPAuth::ProxyBasicAuth か
WEBrick::HTTPAuth::ProxyDigestAuth を使用します。
//emlist{
require 'webrick'
require 'webrick/httpproxy'
auth_proc = proc{|req, res|
unless c = req['proxy-authorization']
res['Proxy-Authenticate'] = 'Basic realm="WEBri...

WEBrick::HTTPAuth::BasicAuth (15046.0)

HTTP の Basic 認証のためのクラスです。

...HTTP の Basic 認証のためのクラスです。



require 'webrick'
realm = "WEBrick's realm"
srv = WEBrick::HTTPServer.new({ :BindAddress => '127.0.0.1', :Port => 10080})

htpd = WEBrick::HTTPAuth::Htpasswd.new('dot.htpasswd')
htpd.set_passwd(nil, 'username', 'supersecre...
...tpass')

authenticator = WEBrick::HTTPAuth::BasicAuth.new(:UserDB => htpd, :Realm => realm)
srv.mount_proc('/basic_auth') {|req, res|
authenticator.authenticate(req, res)
res.body = "hoge"
}
srv.start # http://127.0.0.1:10080/basic_auth...

絞り込み条件を変える

Net::HTTPHeader#basic_auth(account, password) -> [String] (12235.0)

Authorization: ヘッダを BASIC 認証用にセットします。

...Authorization: ヘッダを BASIC 認証用にセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net:...
...:HTTP::Get.new(uri.request_uri)
req.basic_auth("user", "pass") # => ["Basic dXNlcjpwYXNz"]
//}...

Net::HTTPHeader#proxy_basic_auth(account, password) -> [String] (12219.0)

Proxy 認証のために Proxy-Authorization: ヘッダをセットします。

...thorization: ヘッダをセットします。

@param account アカウント名を文字列で与えます。
@param password パスワードを文字列で与えます。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.re...
...quest_uri)
req.proxy_basic_auth("account", "password") # => ["Basic YWNjb3VudDpwYXNzd29yZA=="]
//}...

BasicObject#singleton_method_undefined(name) -> object (12206.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

...
Module#method_undefined を使います。

@param name 未定義にされたメソッド名が Symbol で渡されます。

//emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end

obj = Foo.new
def obj.foo
end
def o...
...bj.bar
end

class << obj
undef_method :foo
end
obj.instance_eval {undef bar}

#=> singleton method "foo" was undefined
# singleton method "bar" was undefined
//}

@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...

BasicObject (12012.0)

特殊な用途のために意図的にほとんど何も定義されていないクラスです。 Objectクラスの親にあたります。Ruby 1.9 以降で導入されました。

...=== 性質
Basic
Object クラスは Object クラスからほとんどのメソッドを取り除いたクラスです。

Object クラスは様々な便利なメソッドや Kernel から受け継いだ関数的メソッド
を多数有しています。
これに対して、 BasicObject クラ...
...ります。

例えば、 BasicObject#method_missingを利用して Proxy パターンを実
装する場合にはObject クラスに定義済みのメソッドはプロクシできないという
問題が発生します。このような場合に Object ではなく BasicObject から派生
...
...合にだけ BasicObject から派生してください。

=== 例

//emlist[例][ruby]{
class Proxy < BasicObject
def initialize(target)
@target = target
end

def method_missing(message, *args)
@target.__send__(message, *args)
end
end

proxy = Proxy.new("1")
proxy.to_i #=> 1
//}...

Time#strftime(format) -> String (9226.0)

時刻を format 文字列に従って文字列に変換した結果を返します。

...角空白で埋める ( 1..31)
* %F: %Y-%m-%d と同等 (ISO 8601の日付フォーマット)
* %G: ISO 8601の暦週の年
* %g: ISO 8601の暦週の年の下2桁(00-99)
* %H: 24時間制の時(00-23)
* %h: %b と同等
* %I: 12時間制の時(01-12)
* %j: 年中の通算日(001-366)...
...list[例][ruby]{
p t = Time.new(2001,2,3,4,5,6,"+09:00") # => 2001-02-03 04:05:06 +0900
p t.strftime("Printed on %m/%d/%Y") # => "Printed on 02/03/2001"
p t.strftime("Printed on %m/%-d/%_6Y") # => "Printed on 02/3/ 2001"
p t.strftime("at %I:%M%p") # => "at 04:05AM"
p t.strftim...
...e("at %I:%M%#p") # => "at 04:05am"
//}

//emlist[様々なISO 8601形式][ruby]{
t = Time.new(2001,2,3,4,5,6,"+09:00")
p t.strftime("%Y%m%d") # => 20010203 Calendar date (basic)
p t.strftime("%F") # => 2001-02-03 Calendar date (ext...

絞り込み条件を変える

<< 1 2 3 ... > >>