Skip to content

詳細フィルタ

フィルタのエンコード

filter name filter description example input example 出力
md5 md5 エンコードされた文字列を返します {{'hey' | md5}} 6057f13c496ecf7fd777ceb9e79ae285
sha1 sha1 エンコードされた文字列 {{'hey' | sha1}} 7f550a9f4c44173a37664d938f1355f0f92a47a7
sha2 sha2 (256 ビット、SHA-256 とも呼ばれます) エンコードされた文字列 {{'hey' | sha2}} fa690b82061edfd2852629aeba897b57e40fcb7d1a7a28b26cba62591204
base64 base64 エンコードされた文字列を返します {{'blah' | base64_encode}} YmxhaA==
hmac_sha1_hex (以前のhmac_sha1) hmac-sha1 シグネチャを返します。16 進文字列としてエンコードされます {{'hey' | hmac_sha1_hex: 'secret_key'}} 2a3969bed25bfeefb00aca4063eb9590b4df8f0e
hmac_sha1_base64 base64 文字列としてエンコードされたhmac-sha1 シグネチャを返します {{'hey' | hmac_sha1_base64: 'secret_key'}} KjlpvtJb/u+wCspAY+uVkLTfjw4=
hmac_sha256_hex 16 進文字列としてエンコードされたhmac-sha256 シグネチャを返します {{'hey' | hmac_sha256_hex: 'secret_key'}} 8df897f8da3d7992fe57c8dbc6f27578cfbf2dcc4d0fb4000b8c924841d508e
hmac_sha256_base64 base64 文字列としてエンコードされたhmac-sha256 シグネチャを返します {{'hey' | hmac_sha256_base64: 'secret_key'}} jfiX+No9eZL+V8jbxvJ1eM+/LcxNDAALjJIQdUI4=

URLフィルタ

filter name filter description example input example 出力
url_escape URLS で許可されていない文字列内のすべての文字を識別し、その文字をエスケープされたバリアント {{'hey<>hi' | url_escape}} hey%3C%3Ehi
url_param_escape URL で許可されていない文字列のすべての文字を、アンパサンド(&) {{'hey<&>hi' | url_param_escape} hey%3C%26%3Ehi
url_encode URLフレンドリな文字列をエンコードする {{ 'google search' | url_encode }} google+search

プロパティアクセサフィルタ

フィルタ名 フィルタの説明
property_accessor ハッシュキーとハッシュキーを取り、そのキーのハッシュの値を返します

ハッシュの例:{"a" => 42, "b" => 0} 入力例:{{hash | property_accessor: 'a'}} 出力例: 42

さらに、プロパティアクセサフィルタを使用すると、カスタム属性をハッシュキーにテンプレート化して特定のハッシュ値にアクセスできます。

数値書式フィルタ

filter name filter description example input example 出力
number_with_delimiter カンマで数値をフォーマット {{ 123456 | number_with_delimiter }} 123,456

JSON エスケープ/文字列エスケープフィルタ

フィルタ名 フィルタの説明
json_escape 文字列の特殊文字をエスケープします(二重引用符"" やバックスラッシュ’\’ など)。

このフィルタは、JSON ディクショナリの文字列をパーソナライズする場合に常に使用する必要があり、特にWebhook に役立ちます。

「このページはどの程度役に立ちましたか?」
New Stuff!