るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

OpenSSL::Cipher#final -> String (21201.0)

暗号オブジェクト内部に残されたデータを暗号化/復号化し、文字列で 返します。

...暗号オブジェクト内部に残されたデータを暗号化/復号化し、文字列で
返します。

パディング(OpenSSL::Cipher#padding=)を有効にしている場合は、
残されたデータにパディングを付加した上で暗号化します。...

ObjectSpace.#define_finalizer(obj) {|id| ...} -> Array (12306.0)

obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。

...ックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するのは...
...い方の注意

以下は、define_finalizer の使い方の悪い例です。

//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
e
nd
e
nd
Foo.new
GC.start
//}

これは、渡された proc の self が obj を参照しつ
づけ...
...ne_finalizer(self, Bar.callback)
e
nd
e
nd
Bar.new
GC.start
//}

proc の呼び出しで発生した大域脱出(exitや例外)は無視されます。
これは、スクリプトのメイン処理が GC の発生によって非同期に中断され
るのを防ぐためです。不安なうちは -...

ObjectSpace.#define_finalizer(obj, proc) -> Array (12306.0)

obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。

...ックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するのは...
...い方の注意

以下は、define_finalizer の使い方の悪い例です。

//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
e
nd
e
nd
Foo.new
GC.start
//}

これは、渡された proc の self が obj を参照しつ
づけ...
...ne_finalizer(self, Bar.callback)
e
nd
e
nd
Bar.new
GC.start
//}

proc の呼び出しで発生した大域脱出(exitや例外)は無視されます。
これは、スクリプトのメイン処理が GC の発生によって非同期に中断され
るのを防ぐためです。不安なうちは -...

ObjectSpace.#undefine_finalizer(obj) -> object (12300.0)

obj に対するファイナライザをすべて解除します。 obj を返します。

...//emlist[例][ruby]{
class Sample
def Sample.callback
proc {
puts "finalize"
}
e
nd

def initialize
ObjectSpace.define_finalizer(self, Sample.callback)
e
nd

def undef
ObjectSpace.undefine_finalizer(self)
e
nd
e
nd

Sample.new
GC.start
# => finalize

Sample.new
sample.u...
...ndef
GC.start
# ※何も出力されない
//}

@see ObjectSpace.#define_finalizer...

Module#ruby2_keywords(method_name, ...) -> nil (6248.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...he given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the...
...ment is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the met...
...er methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
be...

絞り込み条件を変える

Proc#ruby2_keywords -> proc (6248.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

...rks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked wit...
...a special flag such that if it is the final
e
lement of a normal argument splat to another method call, and that
method call does not include explicit keywords or a keyword splat, the
final
element is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods...
...ity. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
proc will change so that it does not pass through keywords.

//emlist[][ruby]{
module Mod
foo = ->(meth, *args, &...

OpenSSL::Cipher#update(data) -> String (6206.0)

渡された文字列を暗号化もしくは復号化して文字列として返します。

...字列を暗号化もしくは復号化して文字列として返します。

どちらがなされるかは直前に OpenSSL::Cipher#encrypt もしくは
OpenSSL::Cipher#decrypt のいずれが呼びだされたかに
よって決まります。

ブロック暗号を利用する場合は、暗...
...保存され、次の文字列が渡されたときに使われます。

暗号化/復号化すべきデータを渡し終えた後は、
OpenSSL::Cipher#final
を呼びだして暗号オブジェクト内部に残されたデータを暗号化/復号化
する必要があります。


@param dat...

cgi/session (6054.0)

CGI のセッション管理を行うライブラリ。

...i/session を使用した方がよりわかりやすいでしょう。
セッション情報は Hash ライクなインターフェースです。

セッションはセッション ID とプログラムが記録した
セッション情報から構成されます。
デフォルトでは CGI::Sessi...
...y
require 'cgi'
require 'cgi/session'

cgi = CGI.new('html3')
File.umask(0077)
session = CGI::Session.new(cgi)
cgi.out('charset'=>'euc-jp') {
html = cgi.html {
cgi.head { cgi.title {'Form Demo'} }
cgi.body {
cgi.form('action'=>"#{CGI.escapeHTML(cgi.script_name)}")...
...ext_field('name') +
cgi.hidden('cmd', 'hello') +
cgi.submit('です。')
}
}
}
}
CGI.pretty(html)
}
#=>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<BODY>
<FORM METHOD="post" ENCTYPE="application/x-www-form-...

OpenSSL::Cipher (6042.0)

共通鍵暗号のために抽象化されたインターフェースを提供するクラスです。

...は暗号アルゴリズムを指定するため
OpenSSL::Cipher.new で暗号オブジェクトを生成することだけでしょう。

もし、このクラスを直接利用して暗号化する場合は、暗号の鍵や
IV(Initialization Vector)の取り扱いについて正しく理解し...
...Cipher#decrypt で
暗号、復号のいずれをするかを設定する
* OpenSSL::Cipher#key=, OpenSSL::Cipher#iv=,
OpenSSL::Cipher#random_key, OpenSSL::Cipher#random_iv などで
鍵と IV(initialization vector) を設定する
* OpenSSL::Cipher#update, OpenSSL::Cipher#final...
...require 'openssl'

# 暗号化するデータ
data = "*secret data*"
# パスワード
pass = "**secret password**"
# salt
salt = OpenSSL::Random.random_bytes(8)

# 暗号化器を作成する
e
nc = OpenSSL::Cipher.new("AES-256-CBC")
e
nc.encrypt
# 鍵とIV(Initialize Vecto...

正規表現 (3720.0)

正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references

...* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references


正規表現(regular expression)は...
...//emlist[][ruby]{
/[a-z]/
/\Axyz\Z/
//}

という正規表現において "[a-z]", "\A", "\Z"はメタ文字列です。

===[a:expansion] 式展開
正規表現内では、#{式} という形式で式を評価した文字列を埋め込むことが
できます。

//emlist[][ruby]{
place = "東...
...外) ([[:^space:]] && ^Control && ^Unassigned && ^Surrogate)
* [:lower:] 小文字 (Lowercase_Letter)
* [:print:] 表示可能な文字(空白を含む) ([[:graph:]] | Space_Separator)
* [:punct:] 句読点 (Connector_Punctuation | Dash_Punctuation | Close_Punctuation | Final_Punctuation | Ini...

絞り込み条件を変える

CGI::HtmlExtension#html(attributes = {}) -> String (3224.0)

トップレベルの html 要素を生成します。 ブロックを与えると、ブロックを評価した結果が内容になります。

...ります。

@param attributes 属性をハッシュで指定します。
擬似属性の "PRETTY" に文字列を与えるとその文字列でインデントした HTML を生成します。
擬似属性の "DOCTYPE" には DOCTYPE 宣言として使用する...
...!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML>string</HTML>

html({ "LANG" => "ja" }){ "string" }
# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML LANG="ja">string</HTML>

html({ "DOCTYPE" => false }){ "string" }
# <HTML>string</HTML>

html({ "DOCTYPE" => '<...
...!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">' }){ "string" }
# <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>string</HTML>

html({ "PRETTY" => " " }){ "<BODY></BODY>" }
# <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
# <HTML>
# <BODY>
# </BODY>
# </HTM...
<< 1 2 > >>